摘要:
http://acm.hdu.edu.cn/showproblem.php?pid=1848组合博弈 sg值我的代码 1 #include <stdio.h> 2 #include <string.h> 3 int main() 4 { 5 const int N=1001,M=17; 6 const char name[2][10]={"Nacci","Fibo"}; 7 int f[M]={1,1}; 8 for (int i=2;i<M;i++) f[i]=f[i-1]+f[i-2]; 9 int a[N]={0},v
阅读全文
摘要:
http://acm.hdu.edu.cn/showproblem.php?pid=1829并查集相同性别的为同一集合,异性的异性为同性我的代码 1 #include <stdio.h> 2 #include <string.h> 3 const int N=2010; 4 int set[N],dsex[N]; 5 int find(int x) 6 { 7 return set[x]==x?x:set[x]=find(set[x]); 8 } 9 int main()10 {11 int T,C=0;12 int n,m,x,y,fx,fy,ans,i;13 ...
阅读全文