Submission #707271

#TimeUsernameProblemLanguageResultExecution timeMemory
707271SamNguyenParrots (IOI11_parrots)C++14
52 / 100
4 ms1060 KiB
#include "encoder.h" #include "encoderlib.h" #include <bits/stdc++.h> using namespace std; void encode(int N, int M[]) { string str; for (int i = 0; i < N; i++) for (int t = 7; t >= 0; t--) str.push_back(((M[i] >> t) & 1) + '0'); for (int i = 0; i < int(str.size()); i++) send(i << 1 | (str[i] - '0')); }
#include "decoder.h" #include "decoderlib.h" #include <bits/stdc++.h> using namespace std; void decode(int N, int L, int X[]) { string str(8 * N, '0'); for (int t = 0; t < L; t++) { int v = X[t] & 1; int i = X[t] >> 1; str[i] = v + '0'; } vector<int> res(N); auto it = str.begin(); for (int i = 0; i < N; i++) { int v = 0; for (int j = 7; j >= 0; j--) v |= (*(it++) - '0') << j; res[i] = v; } for (int e : res) output(e); }
#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...