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"
#include <bits/stdc++.h>
using namespace std;
void encode(int N, int M[])
{
for (int i = 0; i < N; i++) {
//cout << M[i] << " ";
int msg = 0;
msg += (i << 2);
int tmp = M[i];
for (int j = 3; j >= 0; j--) {
int cnt = tmp % 4;
for (int k = 1; k <= cnt; k++) {
send(msg + j);
}
tmp >>= 2;
}
}
}
#include "decoder.h"
#include "decoderlib.h"
#include <bits/stdc++.h>
using namespace std;
void decode(int N, int L, int X[])
{
int origin[64] = { 0, };
for (int i = 0; i < L; i++) {
int idx = X[i] >> 2;
int idx_inner = X[i] % 4;
origin[idx] += 1 << (3 - idx_inner) * 2;
}
for(int i=0; i < N; i++) {
//cout << origin[i] << " ";
output(origin[i]);
}
//cout << endl;
}
# | 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... |