제출 #26900

#제출 시각아이디문제언어결과실행 시간메모리
26900sgc109앵무새 (IOI11_parrots)C++11
52 / 100
6 ms2176 KiB
#include "encoder.h" #include "encoderlib.h" void encode(int N, int M[]) { for(int i = 0 ; i < N; i++){ for(int j = 0 ; j < 4; j++){ int data = (M[i] & (3<<(2*j))) >> (2*j); int bit = 0; bit |= (i<<4); bit |= (j<<2); bit |= data; send(bit); } } }
#include "decoder.h" #include "decoderlib.h" int M[16]; int found[16]; void decode(int N, int L, int X[]) { for(int i = 0 ; i < 16; i++) found[i] = 0, M[i] = 0; int i, b; for(i=0; i<L; i++) { int data = X[i] & 3; X[i] >>= 2; int piece = X[i] & 3; X[i] >>= 2; int order = X[i] & 15; M[order] |= (data << (2*piece)); found[order] = 1; } for(int i = 0 ; i < 16 && found[i]; i++){ output(M[i]); } }

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

decoder.cpp: In function 'void decode(int, int, int*)':
decoder.cpp:9:10: warning: unused variable 'b' [-Wunused-variable]
   int i, b;
          ^
#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...