const int inf=0x3f3f3f3f -- 声明 inf 是 const int型 , const 表示 inf 一旦有了值以后就不允许(通过赋值 来)改变它的值。没有其他意思,就是定义一个“只读”的整型变量 inf,它的值是十六进制的3f3f3f3f。仅此而已。用来代表无穷大
给出以下代码的解释:#include #include #include #include #include using namespace std; const int N = 100; const int M = 500; const int INF = 0x3f3f3f3f; struct Edge { int to, next, cap; }; Edge edge[M]; int... 这是一道网络流模板题,题目描述如下: 给定一个n个点m条边的有向图...
通过从右往左解读p的声明语句可以知道,首先p是一个const变量,然后是一个指向int性的指针。因此与上面的p不能改变对象的值但可以指向另外一个对象相反,这里的p可以改变其所指的对象的值,但p本身的值不能改变,即不能指向其他的对象。 即: 1intcnt =0;23intx =1;45int*constp = &cnt;67p = &x;89//...
在翻转的时候,再另外创建一个数组指向s2,这样再赋值,如果直接移动s2,原来的首地址不好找回 1#include<iostream>2#include<string>3#include<iomanip>4#include5#include<vector>6#include<cmath>7#include<list>8#include<stdlib.h>9#include<ostream>10#include<set>11#include<queue>12#include<stack>13#inclu...
1617# define lllonglong18# define ull unsignedlonglong19# define inf0x3f3f3f3f20# define ll_inf (1ll<<60)21constintmaxn = 2e2 +100;2223voidreverse(constchar*s1,char*s2)24{25intlen,j;2627for( len =0; s1[len] !='\0'; len++);28inti ;29char*tmp =s2;30for( i =0; i <...