Submission #362258

#TimeUsernameProblemLanguageResultExecution timeMemory
362258mosiashvililukaCheerleaders (info1cup20_cheerleaders)C++14
21 / 100
16 ms2156 KiB
#include<bits/stdc++.h> using namespace std; int a,b,c,d,e,i,j,ii,jj,zx,xc,f[1000009],pasii,pasjj,g[1000009],n; long long pas; int main(){ ios_base::sync_with_stdio(false),cin.tie(0),cout.tie(0); cin>>n; a=1; for(i=1; i<=n; i++) a*=2; for(i=0; i<a; i++){ cin>>g[i]; f[i]=i; } pasii=-1;pasjj=-1; for(ii=0; ii<n; ii++){ c=-1; if(ii!=0){ for(i=0; i<a; i++){ if(f[i]%2==0){ f[i]/=2; }else{ f[i]=f[i]/2+(1<<(n-1)); } } } for(i=0; i<a; i++){ if(c==-1){ c=(f[i]^g[i]); }else{ d=(f[i]^g[i]); if(c!=d) break; } } if(i==a){ pasii=ii;pasjj=c; break; } } //cout<<pasii<<" "<<pasjj<<endl; cout<<0<<endl; for(i=0; i<n; i++){ //c=n-1-i-pasii;if(c<0) c=n+c; c=n-1+i;if(c>=n) c-=n; c=c-pasii;if(c<0) c=n+c; //cout<<"kkk"<<c<<endl; if(((1<<c)&pasjj)==0){ }else{ cout<<1; } cout<<2; } for(i=0; i<pasii; i++) cout<<2; return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...