标签:des style blog color java os io strong for
Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 5332 Accepted Submission(s): 3426
1 #include<iostream> 2 #include<string> 3 #include<cstdio> 4 #include<vector> 5 #include<queue> 6 #include<stack> 7 #include<set> 8 #include<algorithm> 9 #include<cstring> 10 #include<stdlib.h> 11 #include<math.h> 12 using namespace std; 13 #define ll __int64 14 int s[20],len,sg[1100],vit[1100]; 15 void getsg(){ 16 for(int i=1;i<=1000;i++){ 17 memset(vit,0,sizeof(vit)); 18 for(int j=0;j<9&&i>=s[j];j++) vit[sg[i-s[j]]]=1; 19 for(int j=0;;j++) 20 if(!vit[j]){ 21 sg[i]=j; 22 break; 23 } 24 } 25 } 26 int main(){ 27 for(int i=0;i<9;i++) s[i]=(1<<i); 28 getsg(); 29 int n; 30 while(cin>>n){ 31 if(sg[n]) cout<<"Kiki"<<endl; 32 else cout<<"Cici"<<endl; 33 } 34 }
标签:des style blog color java os io strong for
原文地址:http://www.cnblogs.com/ainixu1314/p/3932031.html