题解:简单的NIM游戏,直接计算SG函数,至于找先手策略则按字典序异或掉,去除石子后再异或判断,若可行则直接输出。#include const int N=1005;int SG[N],b[N],hash[N],a[N],sum,tmp,i,j,n,m; void FSG(int s){ ...
分类:
其他好文 时间:
2014-07-18 21:09:31
阅读次数:
206
1 class Widget{ 2 3 Widget(); //默认构造函数 4 5 Widget(const Widget& rhs); //复制构造函数 6 7 Widget& operator= (const Widget& rhs);//...
分类:
其他好文 时间:
2014-07-18 20:30:16
阅读次数:
226
题解:正难则反,从总数中减去全部相邻不相同的数目就是答案,n*(n-1)^(m-1):第一个房间有n中染色方案,剩下m-1个房间均只有n-1种染色方案,用总数减就是答案。#include const int mod=100003; typedef long long LL; LL n,m; LL p...
分类:
其他好文 时间:
2014-07-18 20:20:40
阅读次数:
212
#include #include using namespace std;const int N = 505;//////////////////////////////////////////////////////////////////////////////////////////////...
分类:
其他好文 时间:
2014-07-18 20:20:06
阅读次数:
197
内容来源>标题:什么才是不变:const和readonly内容: 我们都知道,const和static readonly的确很像:通过类名而不是对象名进行访问,在程序中只读等等。在多数情况下可以混用。二者本质的区别在于,const的值是在编译期间确定的,因此只能在声明时通过常量表达式指定其值。而st...
分类:
其他好文 时间:
2014-07-18 19:22:36
阅读次数:
192
一、题目源程序#include #include #include int main(void){ const char *Haab[19]={"pop","no","zip","zotz","tzec","xul","yoxkin","mol","chen","yax","zac","ceh...
分类:
其他好文 时间:
2014-07-18 19:11:53
阅读次数:
256
char *strchr(const char *string, int c);查找字符c在字符串string中首次出现的位置, NULL结束符也包含在查找中.返回一个指针, 指向字符c在字符串string中首次出现的位置, 如果没有找到, 则返回NULL.char *strrchr(const c...
分类:
其他好文 时间:
2014-07-18 19:09:58
阅读次数:
202
http://blog.chinaunix.net/uid-22785134-id-360282.html int access(const char *filename, int amode); amode参数为0时表示检查文件的存在性,如果文件存在,返回0,不存在,返回-1。 这个函数还可以检查...
分类:
数据库 时间:
2014-07-18 16:33:06
阅读次数:
235
CGFloat
const gestureMinimumTranslation = 20.0;
typedef enum :
NSInteger {
kCameraMoveDirectionNone,
kCameraMoveDirectionUp,
kCameraMoveDirectionDown,
kCameraMoveDirectionR...
分类:
其他好文 时间:
2014-07-17 16:00:46
阅读次数:
627
int access(const char *filenpath, int mode);功 能: 确定文件或文件夹的访问权限。mode,要判断的模式在头文件unistd.h中的预定义如下:#define R_OK 4 /* Test for read permission. */#define W_...
分类:
数据库 时间:
2014-07-17 13:11:46
阅读次数:
327