Submission #347042

#TimeUsernameProblemLanguageResultExecution timeMemory
347042ACmachineQuestion (Grader is different from the original contest) (CEOI14_question_grader)C++17
0 / 100
0 ms872 KiB
int encode (int n, int x, int y) { int res; if(x > y){ for(int j = 0; j < 12; ++j){ if((x & (1 << j))&&!(y & (1 << j))){ res = j; break; } } } else{ for(int j = 0; j < 12; ++j){ if(!(x & (1 << j)) && (y & (1 << j))){ res = j; break; } } } return res; }
int decode (int n, int q, int h) { return (q & (1 << h)); }

Compilation message (stderr)

encoder.cpp: In function 'int encode(int, int, int)':
encoder.cpp:19:12: warning: 'res' may be used uninitialized in this function [-Wmaybe-uninitialized]
   19 |     return res;
      |            ^~~
#Verdict Execution timeMemoryGrader output
Fetching results...