제출 #1244216

#제출 시각아이디문제언어결과실행 시간메모리
1244216Ice_man앵무새 (IOI11_parrots)C++20
81 / 100
2 ms840 KiB
#include "encoder.h" #include "encoderlib.h" void encode(int N, int M[]) { for(int i = 0; i < N; i++) { int current = 0; int posmask = 0; for(int j = 0; j < 5; j++) if((1 << j) & i) posmask += (1 << j); for(int j = 0; j < 8; j++) if(M[i] & (1 << j)) { current = posmask; for(int k = 0; k < 3; k++) if(j & (1 << k)) current += (1 << (k + 5)); send(current); } } }
#include "decoder.h" #include "decoderlib.h" #include <iostream> #define maxn 100 void decode(int N, int L, int X[]) { int a[maxn]; for(int i = 0; i < N; i++) a[i] = 0; for(int i = 0; i < L; i++) { int m = X[i]; int pos = 0; for(int j = 0; j < 5; j++) if(m & (1 << j)) pos += (1 << j); int pl = 0; for(int j = 0; j < 3; j++) if(m & (1 << (j + 5))) pl += (1 << j); //std::cout << pos << " " << pl << " " << (1 << pl) << "\n"; a[pos] += (1 << pl); } for(int i = 0; i < N; i++) { //std::cout << "!! " << a[i] << "\n"; output(a[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...