#define stack_init_size 100
#define stackincrement 10
typedef int ElemType;
typedef int status;
const status error=0;
const status ok=1;
const status overflow=-2;
const int MAXSIZE = 100;
typedef st...
分类:
其他好文 时间:
2014-05-26 06:17:29
阅读次数:
243
这两天学习了网络流,下面是ISAP算法模板:
const int inf = 0x3fffffff;
template
struct Isap
{
int top;
int d[N], pre[N], cur[N], gap[N];
struct Vertex{
int head;
} V[N];
struct Edge{...
分类:
其他好文 时间:
2014-05-26 04:10:16
阅读次数:
252
简单数论题。区间减法。 1 //Accepted 0 KB 9 ms 2 #include 3
#include 4 using namespace std; 5 const int MAXN = 100005; 6 int f[MAXN]; 7 void
pre() 8 { 9 ...
分类:
其他好文 时间:
2014-05-26 02:54:57
阅读次数:
278
解题思路:求乘法逆元就好了。 1 //Accepted 228 KB 0 ms 2 #include
3 #include 4 const int pp = 9973; 5 int extend_euclid(int a,int b,int &x,int
&y) 6 { 7 ...
分类:
其他好文 时间:
2014-05-26 02:17:41
阅读次数:
210
今天,在看man 9 style时见到了用来处理命令行短形参getopt函数,很是诧异 ——
要知道,我处理命令行参数都是用手动的!于是我如获至宝,赶紧学习学习。getopt的原型被放在unistd.h中,它的原型是这样的:int getopt(int
argc, char * const argv...
分类:
其他好文 时间:
2014-05-26 02:01:30
阅读次数:
252
运算字符的解析,如:43+表示:4+3, 25* 表示:2*5,
25*1+表示(2*5)+1,435/+表示:4 +(3/5) 1 #include 2 #include 3 #include 4 5 bool
isNumber(const char *c); 6 int getNumbe...
分类:
编程语言 时间:
2014-05-26 01:28:47
阅读次数:
357
In this article let us see how to create
Context Menu in Windows Forms application using C#IntroductionIn this article we
will see how to create Conte...
分类:
移动开发 时间:
2014-05-26 01:00:30
阅读次数:
555
按照默认规定,只有一个参数的构造函数也定义了一个隐式转换,将该构造函数对应数据类型的数据转换为该类对象,如下面所示:class
String {String ( const char* p );//用C风格的字符串p作为初始化值//…}String s1 = “hello”;//OK
隐式转换,等价...
分类:
其他好文 时间:
2014-05-26 00:58:49
阅读次数:
265
Format是一个很常用,却又似乎很烦的方法,本人试图对这个方法的帮助进行一些翻译,让它有一个完整的概貌,以供大家查询之用:首先看它的声明:function
Format(const Format: string; const Args: array of const): string; overl...
分类:
其他好文 时间:
2014-05-25 02:04:12
阅读次数:
416
题意:经典八数码问题
思路:HASH+BFS#include
#include
#include
#include
using namespace std;
const int MAXN = 500000;
const int size = 1000003;
typedef int State[9];
char str[30];
int state[9],goal[9]={1, 2, ...
分类:
其他好文 时间:
2014-05-24 21:46:23
阅读次数:
359