Submission #43727

#TimeUsernameProblemLanguageResultExecution timeMemory
43727baactreeParrots (IOI11_parrots)C++14
17 / 100
6 ms1960 KiB
#include "encoder.h" #include "encoderlib.h" void encode(int N, int M[]){ for (int i = 0; i < N; i++) { int a = M[i] >> 4; int b = M[i] & (0xf); send(((i * 2) << 2) + (a >> 2)); send(((i * 2) << 2) + (a >> 2)); send(((i * 2) << 2) + (a & 3)); send(((i * 2 + 1) << 2) + (b >> 2)); send(((i * 2 + 1) << 2) + (b >> 2)); send(((i * 2 + 1) << 2) + (b & 3)); } }
#include "decoder.h" #include "decoderlib.h" void decode(int N, int L, int X[]){ int ans[32] = { 0, }, cnt[64][4] = { 0, }; for (int i = 0; i < L; i++) cnt[X[i] >> 2][X[i] & 3]++; for (int i = 0; i < 64; i++) { for (int j = 0; j < 4; j++) { if (cnt[i][j] == 1) { ans[i / 2] |= i & 1 ? j : j << 4; } else if (cnt[i][j] == 2) { ans[i / 2] |= i & 1 ? j << 2 : j << 6; } } } for (int i = 0; i < N; i++) output(ans[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...