Submission #226278

#TimeUsernameProblemLanguageResultExecution timeMemory
226278Coroian_DavidParrots (IOI11_parrots)C++11
Compilation error
0 ms0 KiB
void encode(int N, int M[]) { int k = 0; int a[700]; for(int i = 0; i < N; i ++) { for(int j = 7; j >= 0; j --) a[++ k] = (((1 << j) & M[i]) != 0); } int cr = 0; for(int i = 1; i <= k; i += 2) { int nr = (a[i] << 1) + a[i + 1]; for(int j = 1; j <= nr; j ++) send(cr); cr ++; } }
void decode(int N, int L, int X[]) { int ap[600]; for(int i = 0; i <= 255; i ++) ap[i] = 0; for(int i = 0; i < L; i ++) ap[X[i]] ++; int cr = 0; for(int i = 0; i < N; i ++) { // cout << " SNUTEM " << cr << " " << ap[cr] << " " << ap[cr + 1] << " " << ap[cr + 2] << " " << ap[cr + 3] << "\n"; int nr = (ap[cr] << 6) + (ap[cr + 1] << 4) + (ap[cr + 2] << 2) + ap[cr + 3]; output(nr); cr += 4; } }

Compilation message (stderr)

encoder.cpp: In function 'void encode(int, int*)':
encoder.cpp:16:13: error: 'send' was not declared in this scope
             send(cr);
             ^~~~

decoder.cpp: In function 'void decode(int, int, int*)':
decoder.cpp:15:9: error: 'output' was not declared in this scope
         output(nr);
         ^~~~~~