제출 #65804

#제출 시각아이디문제언어결과실행 시간메모리
65804ho94949앵무새 (IOI11_parrots)C++17
52 / 100
16 ms2568 KiB
#include "encoder.h" #include "encoderlib.h" void encode(int N, int M[]) { int ans = 0; for(int i=0; i<N; ++i) for(int j=7; j>=0; --j) { if(M[i]&(1<<j)) ++ans; send(ans); } }
#include "decoder.h" #include "decoderlib.h" #include <vector> #include <algorithm> #include <cstdio> void decode(int N, int L, int X[]) { std::vector<int> p(X, X+L); p.push_back(0); std::sort(p.begin(), p.end()); int ans = 0; for(int i=0; i<L; ++i) { ans = 2 * ans + (p[i+1] - p[i]); if((i&7) == 7) { output(ans); ans = 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...