Submission #189118

#TimeUsernameProblemLanguageResultExecution timeMemory
189118TadijaSebezQuestion (Grader is different from the original contest) (CEOI14_question_grader)C++11
60 / 100
1620 ms80304 KiB
int encode (int n, int x, int y) { for(int i=0;i<10;i++) { if((x>>i&1) && !(y>>i&1)) return i+1; } int sum1=0,sum2=0; for(int i=0;i<10;i++) sum1+=x>>i&1,sum2+=y>>i&1; sum1--;sum2--; for(int i=0;i<4;i++) { if(!(sum1>>i&1) && (sum2>>i&1)) return 11+i; } }
int decode (int n, int q, int h) { if(h<=10) { h--; if(q>>h&1) return 1; else return 0; } else { h-=11; int sum=0; for(int i=0;i<10;i++) sum+=q>>i&1; sum--; if(!(sum>>h&1)) return 1; else return 0; } }

Compilation message (stderr)

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