Submission #706144

#TimeUsernameProblemLanguageResultExecution timeMemory
706144tht2005Parrots (IOI11_parrots)C++17
24 / 100
8 ms1392 KiB
#include "encoder.h" #include "encoderlib.h" void encode(int N, int M[]) { for(int i = 0; i < N; i += 2) { int pos = i >> 1; int x = M[i], y = (i + 1 == N) ? 0 : M[i + 1]; for(int t = 8; t--; ) { int cnt = (x >> t & 1) | ((y >> t & 1) << 1); while(cnt--) { send((t << 5) | pos); } } } }
#include "decoder.h" #include "decoderlib.h" #include <cstring> int cnt[8][100], res[100]; void decode(int N, int L, int X[]) { memset(cnt, 0, sizeof(cnt)); for(int i = 0; i < L; ++i) { ++cnt[X[i] >> 5][X[i] & 31]; } memset(res, 0, sizeof(res)); for(int t = 8; t--; ) { for(int i = (N - 1) >> 1; i >= 0; --i) { if(cnt[t][i] & 1) { res[i << 1] |= 1 << t; } if(cnt[t][i] >> 1 & 1) { res[i << 1 | 1] |= 1 << t; } } } for(int i = 0; i < N; ++i) { output(res[i]); } }
#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...