This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include "encoder.h"
#include "encoderlib.h"
void encode(int N, int M[]) {
int x = 0;
for (int i = N - 1; i >= 0; i --) {
x += M[i] * (1 << (N-1-i));
}
send(x);
}
#include "decoder.h"
#include "decoderlib.h"
#include <vector>
#include <algorithm>
void decode(int N, int L, int X[]) {
std::vector <int> res;
for (int i = 0; i < N; i ++) {
res.push_back(X[0] % 2);
X[0] /= 2;
}
reverse(res.begin(), res.end());
for (auto i: res) output(i);
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |