Submission #1023236

#TimeUsernameProblemLanguageResultExecution timeMemory
1023236codefoxQuestion (Grader is different from the original contest) (CEOI14_question_grader)C++14
Compilation error
0 ms0 KiB
#pragma GCC target("popcnt") #pragma GCC optimize("Ofast") #include<bits/stdc++.h> vector<int> ps(923, 0); void init() { for (int j = 30; j < (1<<12); j++) { if (__builtin_popcount(j)==6) { k++; ps[k] = j; } } } int encode(int n, int a, int b) { for (int h = 0; h< 12; h++) { if ((ps[a]&(1<<h)) && ((ps[b]&(1<<h))==0)) return h+1; } }
#pragma GCC target("popcnt") #pragma GCC optimize("Ofast") #include<bits/stdc++.h> vector<int> ps(923, 0); void init() { for (int j = 30; j < (1<<12); j++) { if (__builtin_popcount(j)==6) { k++; ps[k] = j; } } } int decode(int n, int q, int h) { h--; if (ps[q]&(1<<h)) return true; return false; }

Compilation message (stderr)

encoder.cpp:5:1: error: 'vector' does not name a type
    5 | vector<int> ps(923, 0);
      | ^~~~~~
encoder.cpp: In function 'void init()':
encoder.cpp:13:7: error: 'k' was not declared in this scope
   13 |       k++;
      |       ^
encoder.cpp:14:7: error: 'ps' was not declared in this scope
   14 |       ps[k] = j;
      |       ^~
encoder.cpp: In function 'int encode(int, int, int)':
encoder.cpp:23:10: error: 'ps' was not declared in this scope
   23 |     if ((ps[a]&(1<<h)) && ((ps[b]&(1<<h))==0)) return h+1;
      |          ^~
encoder.cpp:25:1: warning: control reaches end of non-void function [-Wreturn-type]
   25 | }
      | ^

decoder.cpp:5:1: error: 'vector' does not name a type
    5 | vector<int> ps(923, 0);
      | ^~~~~~
decoder.cpp: In function 'void init()':
decoder.cpp:13:7: error: 'k' was not declared in this scope
   13 |       k++;
      |       ^
decoder.cpp:14:7: error: 'ps' was not declared in this scope
   14 |       ps[k] = j;
      |       ^~
decoder.cpp: In function 'int decode(int, int, int)':
decoder.cpp:22:7: error: 'ps' was not declared in this scope
   22 |   if (ps[q]&(1<<h)) return true;
      |       ^~