标签:input represent bsp int nim and lease eve not
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)
Total Submission(s): 948 Accepted Submission(s): 559
1 #include<iostream> 2 #include<cstdio> 3 #include<cmath> 4 #include<cstring> 5 using namespace std; 6 int visited[100]; 7 int sg[100]; 8 int main(){ 9 /*int i,j,k; 10 for(i=1;i<40;i++){ 11 memset(visited,0,sizeof(visited)); 12 for(j=0;j<i;j++)visited[sg[j]]=1; 13 for(j=1;j<i;j++){ 14 for(k=1;k+j<i;k++){ 15 visited[sg[j]^sg[k]^sg[i-k-j]]=1; 16 } 17 } 18 for(j=0;j<40;j++){ 19 if(visited[j]==0){ 20 break; 21 } 22 } 23 sg[i]=j; 24 } 25 for(i=1;i<40;i++){ 26 cout<<i<<" "<<sg[i]<<endl; 27 }*/ 28 int t; 29 scanf("%d",&t); 30 int n,i,x; 31 int ans; 32 while(t--){ 33 scanf("%d",&n); 34 ans=0; 35 for(i=0;i<n;i++){ 36 scanf("%d",&x); 37 if(x%8==0){ 38 x=x-1; 39 ans=ans^x; 40 } 41 else if(x%8==7){ 42 x=x+1; 43 ans=ans^x; 44 } 45 else 46 ans=ans^x; 47 48 } 49 cout<<ans<<endl; 50 } 51 }
标签:input represent bsp int nim and lease eve not
原文地址:http://www.cnblogs.com/Aa1039510121/p/6012769.html