제출 #595858

#제출 시각아이디문제언어결과실행 시간메모리
595858proma앵무새 (IOI11_parrots)C++17
34 / 100
2 ms1040 KiB
#include "encoder.h" #include "encoderlib.h" #include <iostream> void encode(int N, int M[]) { for (int i = 0; i < N; i ++) { int x = M[i]; int k = i; for (int j = 8; j < 12; j ++) { x += (k % 2) * (1 << j); k /= 2; } // std::cout << x << " "; send(x); } // std::cout << std::endl; }
#include "decoder.h" #include "decoderlib.h" #include <vector> #include <algorithm> #include <iostream> void decode(int N, int L, int X[]) { std::vector <int> res(N); for (int i = 0; i < N; i ++) { int val = 0; for (int j = 0; j < 8; j ++) { val += (X[i] % 2) * (1 << j); X[i] /= 2; } int pos = 0; for (int j = 8; j < 12; j ++) { pos += (X[i] % 2) * (1 << (j - 8)); X[i] /= 2; } res[pos] = val; } for (auto i: res) { // std::cout << i << " "; output(i); }// std::cout << std::endl; }
#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...