제출 #934576

#제출 시각아이디문제언어결과실행 시간메모리
934576KebabuVaikis15앵무새 (IOI11_parrots)C++14
81 / 100
3 ms1336 KiB
#include "encoder.h" #include "encoderlib.h" void encode(int N, int M[]) { if (N<=32) { for (int i=0; i<N; i++) for (int j=0; j<8; j++) if (M[i]&(1<<j)) send((j<<5)+i); } else { for (int i=0; i<N; i++) for (int j=0; j<4; j++) for (int k=0; k<(M[i]>>2*j)&3; k++) send((j<<6)+i); } }
#include "decoder.h" #include "decoderlib.h" void decode(int N, int L, int X[]) { int M[N]={0}; if (N<=32) for (int i=0; i<L; i++) M[X[i]&((1<<5)-1)]+=(1<<(X[i]>>5)); else for (int i=0; i<L; i++) M[X[i]&((1<<6)-1)]+=(1<<(2*(X[i]>>6))); for (int i:M) output(i); }

컴파일 시 표준 에러 (stderr) 메시지

encoder.cpp: In function 'void encode(int, int*)':
encoder.cpp:17:32: warning: suggest parentheses around comparison in operand of '&' [-Wparentheses]
   17 |                 for (int k=0; k<(M[i]>>2*j)&3; k++)
      |                               ~^~~~~~~~~~~~
#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...