Submission #602226

#TimeUsernameProblemLanguageResultExecution timeMemory
602226ThegeekKnight16Parrots (IOI11_parrots)C++14
81 / 100
5 ms1204 KiB
#include <bits/stdc++.h> #include "encoder.h" #include "encoderlib.h" using namespace std; void encode(int N, int M[]) { int R = 0; for (int i = 0; i < N; i++) { R = (i << 3) + (M[i] & 7); send(R); R = (i << 3) + ((M[i] >> 3) & 7); send(R); send(R); R = (i << 3) + ((M[i] >> 6) & 7); send(R); send(R); send(R); send(R); //cerr << "AAAAA" << '\n'; } }
#include <bits/stdc++.h> #include "decoder.h" #include "decoderlib.h" using namespace std; void decode(int N, int L, int X[]) { int M[300], Marc[300]; for (int i = 0; i < 266; i++) {M[i] = 0; Marc[i] = 0;} sort(X, X+L); //cerr << "BBBBBBB" << '\n'; for (int i = 0; i < L; i++) { Marc[X[i]]++; } for (int i = 0; i <= 255; i++) { if (Marc[i] == 0) continue; //cerr << "Marc[" << i << "]: " << Marc[i] << '\n'; if (Marc[i] & 1) M[(i >> 3)] += ((i & 7) << 0); if (Marc[i] & 2) M[(i >> 3)] += ((i & 7) << 3); if (Marc[i] & 4) M[(i >> 3)] += ((i & 7) << 6); } for (int i = 0; i < N; i++) output(M[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...