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[])
{
for (int i = 0; i < N; 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"
int origin[64];
void decode(int N, int L, int X[])
{
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;
}
int i, b;
for(i=0; i < N; i++) {
b = origin[i];
output(b);
}
}
# | 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... |