Submission #1035206

#TimeUsernameProblemLanguageResultExecution timeMemory
1035206NeroZeinParrots (IOI11_parrots)C++17
52 / 100
2 ms1336 KiB
#include "encoder.h" #include "encoderlib.h" #include <bits/stdc++.h> using namespace std; void encode(int N, int M[]) { for (int i = 0; i < N; ++i) { for (int j = 0; j < 4; ++j) { int num = i | (j << 4); int b = ((M[i] >> (j * 2) & 1) << 6); b |= ((M[i] >> (j * 2 + 1) & 1) << 7); num |= b; //cerr << "i, j, num: " << i << ' ' << j << ' ' << num << '\n'; send(num); } } }
#include "decoder.h" #include "decoderlib.h" #include <bits/stdc++.h> using namespace std; void decode(int N, int L, int X[]) { vector<int> ans(N); for (int i = 0; i < L; ++i) { int ind = 0; for (int j = 0; j < 4; ++j) { ind |= ((X[i] & 1) << j); X[i] >>= 1; } int ord = 0; for (int j = 0; j < 2; ++j) { ord |= ((X[i] & 1) << j); X[i] >>= 1; } int b = X[i]; ans[ind] |= (b << (2 * ord)); } 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...