Submission #564861

#TimeUsernameProblemLanguageResultExecution timeMemory
564861UzoufQuestion (Grader is different from the original contest) (CEOI14_question_grader)C++14
0 / 100
7050 ms5348 KiB
int encode(int n,int x,int y) { int grid[924]; int col=-1; for (int msk=0;msk<(1<<12);msk++) { if (__builtin_popcount(msk)!=6) continue; col++; grid[col]=msk; } int h; for (int i=0;i<12;i++) { if ((grid[x-1]&(1<<i))==(1<<i) && (grid[y-1]&(1<<i))!=(1<<i)) { h=i+1; break; } } return h; }
int decode(int n,int q,int h) { h--; q--; int grid[924]; int col=-1; for (int msk=0;msk<(1<<12);msk++) { if (__builtin_popcount(msk)!=6) continue; col++; grid[col]=msk; } int ans; if ((grid[q]&(1<<h))==(1<<h)) ans=1; else ans=0; return ans; }

Compilation message (stderr)

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