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 mask[8] = { 1,2,4,8,16,32,64,128 };
for (int i = 0; i < N; i++){
int message = M[i];
int loc = i << 2;
for (int m = 0; m < 8; m+=2){
if (message&mask[m]){
send(loc + m / 2);
}
if (message&mask[m+1]){
send(loc + m / 2);
send(loc + m / 2);
}
}
}
}
#include "decoder.h"
#include "decoderlib.h"
void decode(int N, int L, int X[]){
int M[64] = { 0 };
for (int i = 0; i < L; i++){
int message = X[i];
int loc = message >> 2;
M[loc] += 1<<((message % 4)*2);
}
for (int i = 0; i < N; i++){
output(M[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... |