Submission #11167

#TimeUsernameProblemLanguageResultExecution timeMemory
11167gs13068Question (Grader is different from the original contest) (CEOI14_question_grader)C++98
100 / 100
1588 ms25680 KiB
static int flag; static int a[1000]; void init() { if(!flag) { int i,j,k,n=0; for(i=0;i<4096;i++) { k=0; for(j=0;j<12;j++)k+=(i>>j)&1; if(k==6)a[n++]=i; } flag=1; } } int encode(int N,int x,int y) { int i; init(); for(i=0;i<12;i++)if(((a[x]>>i)&1)&&!((a[y]>>i)&1))return i+1; while(1); }
static int flag; static int a[1000]; void init() { if(!flag) { int i,j,k,n=0; for(i=0;i<4096;i++) { k=0; for(j=0;j<12;j++)k+=(i>>j)&1; if(k==6)a[n++]=i; } flag=1; } } int decode(int N,int x,int y) { init(); return (a[x]>>(y-1))&1; }
#Verdict Execution timeMemoryGrader output
Fetching results...