제출 #53008

#제출 시각아이디문제언어결과실행 시간메모리
53008SpaimaCarpatilor앵무새 (IOI11_parrots)C++17
81 / 100
9 ms2320 KiB
#include "encoder.h" #include "encoderlib.h" void encode(int N, int M[]) { /* if (N <= 16) { int sz = 0, v[200]; for (int i=0; i<N; i++) for (int j=0; j<8; j++) v[sz ++] = (M[i] >> j) & 1; for (int i=0; 2 * i < sz; i++) { int msk = (i << 2) | (v[2 * i] << 1) | v[2 * i + 1]; send (msk); } return ; }*/ int sz = 0, v[1000]; for (int i=0; i<N; i++) for (int j=0; j<8; j++) v[sz ++] = (M[i] >> j) & 1; for (int i=0; i<sz; i++) if (v[i]) send (i); }
#include "decoder.h" #include "decoderlib.h" void decode(int N, int L, int X[]) { /* if (N <= 16) { int v[200]; for (int i=0; i<L; i++) { int pos = X[i] >> 2; v[2 * pos + 1] = X[i] & 1; v[2 * pos] = (X[i] >> 1) & 1; } for (int j=0; j<2 * L; j+=8) { int msk = 0; for (int k=j; k<j + 8; k++) if (v[k]) msk |= 1 << (k - j); output (msk); } return ; }*/ int v[1000]; for (int i=0; i<8 * N; i++) v[i] = 0; for (int i=0; i<L; i++) v[X[i]] = 1; for (int j=0; j<8 * N; j+=8) { int msk = 0; for (int k=j; k<j + 8; k++) if (v[k]) msk |= 1 << (k - j); output (msk); } }
#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...