Submission #1033160

#TimeUsernameProblemLanguageResultExecution timeMemory
1033160aymanrsParrots (IOI11_parrots)C++14
81 / 100
3 ms1348 KiB
#include "encoder.h" #include "encoderlib.h" void encode(int N, int M[]) { for(int i = 0;i < N;i++){ send(i*8+(M[i]&3)); send(i*8+(M[i]&3)); send(i*8+(M[i]>>2&3)); send(i*8+4+(M[i]>>4&3)); send(i*8+4+(M[i]>>4&3)); send(i*8+4+(M[i]>>6&3)); } }
#include "decoder.h" #include "decoderlib.h" #include <vector> #include <algorithm> static std::pair<int, int> gh(int a, int b, int c){ int f = a^b^c; if(f==a) return {b^(b&4),f^(f&4)}; return {a^(a&4),f^(f&4)}; } void decode(int N, int L, int X[]) { std::vector<int> a[N]; for(int i=0; i<L; i++) { a[X[i]>>3].push_back(X[i]&7); } for(int i = 0;i < N;i++){ std::sort(a[i].begin(), a[i].end()); auto vl = gh(a[i][0], a[i][1], a[i][2]), vr = gh(a[i][3],a[i][4],a[i][5]); output(vl.first+4*vl.second+16*vr.first+64*vr.second); } }
#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...