# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
65862 | 2018-08-09T04:40:41 Z | lipschitz | Parrots (IOI11_parrots) | C++14 | 0 ms | 0 KB |
#include "encoder.h" #include "encoderlib.h" void encode(int N, int M[]) { int i; if (N > 32) { int mask = 0x000f; for (i = 0; i < N; i++) { int seq = i << 2; int temp = M[i]&mask; for (int j = 0; j < 4; j++) { if (temp & 1) { send(seq + j); } temp >>= 1; } temp = (M[i] >> 4)&mask; for (int j = 0; j < 4; j++) { if (temp & 1) { send(seq + j); send(seq + j); } temp >>= 1; } } return; } for (i = 0; i < N; i++) { int seq = i << 3; int temp = M[i]; for (int j = 0; j < 8; j++) { if (temp & 1) { send(seq + j); } temp >>= 1; } } }