Submission #934667

#TimeUsernameProblemLanguageResultExecution timeMemory
934667tamyteParrots (IOI11_parrots)C++14
34 / 100
1 ms1316 KiB
#include "encoder.h" #include "encoderlib.h" void encode(int N, int M[]) { int i; for(i=0; i<N; i++) { int now = i + (M[i] << 4); send(now); } }
#include "decoder.h" #include "decoderlib.h" #include <vector> void decode(int N, int L, int X[]) { int i; std::vector<int> res(N); for(i=0; i<L; i++) { int num = 0; for (int j = (1 << 4); j <= X[i]; j <<= 1) { if (j & X[i]) { num += (j >> 4); } } int idx = 0; for (int j = 0; j < 4; ++j) { if ((1 << j) & X[i]) { idx += (1 << j); } } // std::cout << idx << " " << num << " <- " << X[i] << "\n"; res[idx] = num; } for (int i = 0; i < N; ++i) { output(res[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...