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 i;
for(i=0; i<N; i++){
int nuevoi=(i<<8);
M[i]|=nuevoi;
send(M[i]);
}
}
#include "decoder.h"
#include "decoderlib.h"
void decode(int N, int L, int X[]) {
int arr[N];
for(int i=0;i<L;i++){
int elemento=0;
int pos=0;
for(int bit=0;bit<8;bit++){
if(X[i]&bit){
elemento+=(1<<bit);
}
}
for(int bit=8;bit<16;bit++){
if(X[i]&bit){
pos+=(1<<(bit-8));
}
}
arr[pos]=elemento;
}
for(int i=0;i<N;i++){
output(arr[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... |