제출 #65831

#제출 시각아이디문제언어결과실행 시간메모리
65831asonetu앵무새 (IOI11_parrots)C++14
95 / 100
19 ms2576 KiB
#include "encoder.h" #include "encoderlib.h" void encode(int N, int M[]) { for(int i=0; i<N; i++) { int pos = i; int vals[3]; vals[0] = M[i] / 100; vals[1] = (M[i] % 100) / 10; vals[2] = M[i] % 10; while(vals[0] != 0 || vals[1] != 0 || vals[2] != 0) { int sendVal = pos << 2; if(vals[0] != 0) { vals[0]--; } else { if(vals[1] != 0) { sendVal = sendVal | ( 1 << 1); vals[1]--; } if(vals[2] != 0) { sendVal = sendVal | 1; vals[2]--; } } send(sendVal); } } }
#include "decoder.h" #include "decoderlib.h" void decode(int N, int L, int X[]) { int result[N]; for(int i=0; i<N; i++) { result[i] = 0; } for(int i=0; i<L; i++) { int pos = X[i] >> 2; int val = 0; if(!(X[i] & 2) && !(X[i] & 1)) { val = val + 100; } if(X[i] & 2) { val = val + 10; } if(X[i] & 1) { val = val + 1; } result[pos] = result[pos] + val; } for(int i=0; i<N; i++) { output(result[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...