Submission #343686

#TimeUsernameProblemLanguageResultExecution timeMemory
343686juggernautQuestion (Grader is different from the original contest) (CEOI14_question_grader)C++14
100 / 100
3805 ms24384 KiB
static int arr[924],pos; int encode (int n, int x, int y){ if(!pos){ int a,b; for(int i=0;i<4096;i++){ a=i;b=0; while(a>=1){ b+=(a%2); a/=2; } if(b==6) arr[pos++]=i; } } x=arr[x-1];y=arr[y-1]; for(int i=0;i<12;i++) if(x>>i&1 && !(y>>i&1)) return i+1; }
static int arr[924],pos; int decode (int n, int q, int h) { if(!pos){ int a,b; for(int i=0;i<4096;i++){ a=i;b=0; while(a>=1){ b+=(a%2); a/=2; } if(b==6) arr[pos++]=i; } } return (arr[q-1]>>(h-1)&1); }

Compilation message (stderr)

encoder.cpp: In function 'int encode(int, int, int)':
encoder.cpp:19:1: warning: control reaches end of non-void function [-Wreturn-type]
   19 | }
      | ^
#Verdict Execution timeMemoryGrader output
Fetching results...