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 number=i;
for(int j=0;j<4;j++){
int binary_pos=j;
binary_pos=(binary_pos<<4);
number|=binary_pos;
int aux=(1<<((j+1)*2))-1;
aux=aux-((1<<((j)*2))-1);
int segment=(M[i]&aux);
segment=(segment<<6);
number|=segment;
send(number);
}
}
}
#include "decoder.h"
#include "decoderlib.h"
#include<bits/stdc++.h>
using namespace std;
void decode(int N, int L, int X[])
{
vector<int> ans(N);
for(int i=0;i<L;i++){
int idx=(X[i]%16);
X[i]=(X[i]>>4);
int part=X[i]%4;
X[i]=(X[i]>>2);
ans[idx]+=(X[i]<<(part*2));
}
}
# | 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... |