Submission #668507

#TimeUsernameProblemLanguageResultExecution timeMemory
668507RambaXGorillaQuestion (Grader is different from the original contest) (CEOI14_question_grader)C++17
0 / 100
7075 ms5852 KiB
using namespace std; int conv(int a){ for(int i = 0, j = 0;i < 1 << 12;i++){ if(__builtin_popcount(i) == 6){ j++; if(j == a) return i; } } } int encode(int N, int X, int Y){ X = conv(X); Y = conv(Y); return __builtin_ctz(X ^ (X & Y)) + 1; } int decode(int N, int Q, int H){ return (bool) (conv(Q) & 1 << H - 1); }
using namespace std; int conv(int a){ for(int i = 0, j = 0;i < 1 << 12;i++){ if(__builtin_popcount(i) == 6){ j++; if(j == a) return i; } } } int encode(int N, int X, int Y){ X = conv(X); Y = conv(Y); return __builtin_ctz(X ^ (X & Y)) + 1; } int decode(int N, int Q, int H){ return (bool) (conv(Q) & 1 << H - 1); }

Compilation message (stderr)

encoder.cpp: In function 'int decode(int, int, int)':
encoder.cpp:19:37: warning: suggest parentheses around '-' inside '<<' [-Wparentheses]
   19 |     return (bool) (conv(Q) & 1 << H - 1);
      |                                   ~~^~~
encoder.cpp: In function 'int conv(int)':
encoder.cpp:10:1: warning: control reaches end of non-void function [-Wreturn-type]
   10 | }
      | ^

decoder.cpp: In function 'int decode(int, int, int)':
decoder.cpp:19:37: warning: suggest parentheses around '-' inside '<<' [-Wparentheses]
   19 |     return (bool) (conv(Q) & 1 << H - 1);
      |                                   ~~^~~
decoder.cpp: In function 'int conv(int)':
decoder.cpp:10:1: warning: control reaches end of non-void function [-Wreturn-type]
   10 | }
      | ^
#Verdict Execution timeMemoryGrader output
Fetching results...