Submission #767016

#TimeUsernameProblemLanguageResultExecution timeMemory
767016raysh07Parrots (IOI11_parrots)C++17
0 / 100
2 ms1060 KiB
#include "encoder.h" #include "encoderlib.h" #include <bits/stdc++.h> using namespace std; void encode(int n, int a[]) { // int i; // for(i=0; i<N; i++) // send(M[i]); if (n <= 32){ for (int i = 0; i < n; i++){ for (int j = 0; j < 8; j++){ if (a[i] >> j & 1){ send(8 * i + j); } } } } }
#include "decoder.h" #include "decoderlib.h" #include <bits/stdc++.h> using namespace std; void decode(int n, int l, int a[]) { //l is length of encoded sequence //n is the answer we need int cnt[256]; for (int i = 0; i < l; i++) cnt[a[i]]++; if (n <= 32){ int ans[n]; for (int i = 0; i < 256; i++){ if (cnt[i] == 1){ ans[i / 8] += 1 << (i % 8); } } for (int i = 0; i < n; i++){ output(ans[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...