제출 #65805

#제출 시각아이디문제언어결과실행 시간메모리
65805ho94949앵무새 (IOI11_parrots)C++17
52 / 100
12 ms2272 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; if(ans != 256) 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); while((int)p.size() <= 8*N) p.push_back(256); 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...