제출 #65852

#제출 시각아이디문제언어결과실행 시간메모리
65852lipschitz앵무새 (IOI11_parrots)C++14
81 / 100
8 ms2192 KiB
#include "encoder.h" #include "encoderlib.h" void encode(int N, int M[]) { int i; 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; } } }
#include "decoder.h" #include "decoderlib.h" #include<algorithm> using namespace std; void decode(int N, int L, int X[]) { int i, mask = 0x0007; int b[64]; for (int i = 0; i < 64; i++) b[i] = 0; sort(X, X + L); int seq = 0, ans = 0; for(i=0; i<L; i++) { if ((X[i] >> 3)^seq) { b[seq] = ans; ans = 0; seq = X[i] >> 3; } ans += (1 << (X[i] & mask)); } b[seq] = ans; for (int i = 0; i < N; i++) output(b[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...