Submission #254674

#TimeUsernameProblemLanguageResultExecution timeMemory
254674SortingParrots (IOI11_parrots)C++14
88 / 100
9 ms1792 KiB
#include "encoder.h" #include "encoderlib.h" #include <bits/stdc++.h> using namespace std; void encode(int N, int M[]){ if(N > 32){ for(int i = 0; i < N; ++i){ for(int j = 0; j <= 7; ++j){ if(M[i] & (1 << j)){ if(i >= 32){ send((i - 32) * 8 + j); send((i - 32) * 8 + j); } else send(i * 8 + j); } } } return; } for(int i = 0; i < N; ++i){ for(int j = 0; j <= 7; ++j){ if(M[i] & (1 << j)) send(i * 8 + j); } } }
#include "decoder.h" #include "decoderlib.h" #include <bits/stdc++.h> using namespace std; static int e[256]; void decode(int N, int L, int X[]){ for(int i = 0; i < 256; ++i) e[i] = 0; if(N > 32){ for(int i = 0; i < L; ++i) e[X[i]]++; for(int i = 0; i < N; ++i){ int curr = 0; for(int j = 0; j <= 7; ++j){ if(i >= 32){ if(e[(i - 32) * 8 + j] & 2) curr += (1 << j); } else{ if(e[i * 8 + j] & 1) curr += (1 << j); } } output(curr); } return; } for(int i = 0; i < L; ++i) e[X[i]] = true; for(int i = 0; i < N; ++i){ int curr = 0; for(int j = 0; j <= 7; ++j){ if(e[i * 8 + j]) curr += (1 << j); } output(curr); } }
#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...