Submission #17112

#TimeUsernameProblemLanguageResultExecution timeMemory
17112muratParrots (IOI11_parrots)C++98
0 / 100
8 ms2400 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[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[P[c]]++; c++; } } int mx = max(max(cc[0], cc[1]), max(cc[2], cc[3])); if(mx == cc[0]) { t = 0; send(0); send(0); send(0); send(0); send(0); send(0);} else if(mx == cc[1]) { t = 1; send(1); send(1); send(1); send(1); send(1); send(1);} else if(mx == cc[2]) { t = 2; send(2); send(2); send(2); send(2); send(2); send(2);} else if(mx == cc[3]) { t = 3; send(3); send(3); send(3); send(3); send(3); send(3);} for(int i = 0; i < N * 4; i++) { if(cc[i] == t) cc[i] = 0; while(cc[i]--) send(i); } }
#include "decoder.h" #include "decoderlib.h" #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]]++; } if(cc[0] > 5) { cc[0] -= 6; t = 0;} if(cc[1] > 5) { cc[1] -= 6; t = 1;} if(cc[2] > 5) { cc[2] -= 6; t = 2;} if(cc[3] > 5) { cc[3] -= 6; t = 3;} for(int i = 0; i < N * 4; i++) { if(cc[i] == 0) cc[i] = t; else if(cc[i] < t) 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:31:9: warning: 't' may be used uninitialized in this function [-Wmaybe-uninitialized]
         if(cc[i] == t) cc[i] = 0;
         ^~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...