Submission #17128

#TimeUsernameProblemLanguageResultExecution timeMemory
17128muratParrots (IOI11_parrots)C++98
Compilation error
0 ms0 KiB
#include "encoder.h" #include "encoderlib.h" #include<bits/stdc++.h> using namespace std; void encode(int N, int M[]) { int c = 0, t; vector< int > v[5]; int P[500] = {0}; int cc[2][500] = {0}; for(int i=0; i<N; i++) { int tt = M[i]; for(int j = 0; j < 8; j+=2) { P[c] = (tt >> (6-j)) & 3; cc[1][3-P[c]]++; cc[0][P[c]]++; c++; } } int t1 = cc[0][1] + cc[0][1] * 2 + cc[0][3] * 3; int t2 = cc[1][1] + cc[1][2] * 2 + cc[1][3] * 3; int w = 0; if(t2 < t1) w = 1; send(w); send(w); send(w); send(w); for(int i = 0; i < c; i++) { if(w) P[i] = 3 - P[i]; while(P[i]--) { send(i); } } }
#include<bits/stdc++.h> using namespace std; void decode(int N, int L, int X[]) { int cc[500] = {0}, t = 0; for(int i=0; i<L; i++) cc[X[i]]++; int w = 0; if(cc[0] > 3) { cc[0] -= 4; w = 0;} if(cc[1] > 3) { cc[1] -= 4; w = 1;} for(int i = 0; i < N * 4; i++) { if(w) cc[i] = 3 - cc[i]; if(i % 4 == 3) { int t = 64 * cc[i-3] + 16 * cc[i-2] + 4 * cc[i-1] + cc[i]; output(t); } } }

Compilation message (stderr)

encoder.cpp: In function 'void encode(int, int*)':
encoder.cpp:9:16: warning: unused variable 't' [-Wunused-variable]
     int c = 0, t;
                ^

decoder.cpp: In function 'void decode(int, int, int*)':
decoder.cpp:20:13: error: 'output' was not declared in this scope
             output(t);
             ^~~~~~
decoder.cpp:20:13: note: suggested alternative: 'getpt'
             output(t);
             ^~~~~~
             getpt
decoder.cpp:7:24: warning: unused variable 't' [-Wunused-variable]
     int cc[500] = {0}, t = 0;
                        ^