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;
#define pb push_back
#define mp make_pair
#define ll long long
#define itr ::iterator
typedef pair<int,int> pii;
const int MAX=1e5;
void encode(int N,int M[])
{
for(int A=0;A<N;A++)
for(int B=0;B<8;B+=2)
if((M[A]&(1<<B)) and (M[A]&(1<<(B+1))))
send((8*A+B)/2);
else if(M[A]&(1<<B))
send((8*A+B)/2),
send((8*A+B)/2);
else if(M[A]&(1<<(B+1)))
send((8*A+B)/2),
send((8*A+B)/2),
send((8*A+B)/2);
return ;
}
#include "decoder.h"
#include "decoderlib.h"
void decode(int N, int L, int X[])
{
int arr[1000]={0};
for(int A=0;A<L;A++)
arr[X[A]]++;
for(int A=0;A<N;A++)
{
int cur=0;
for(int B=0;B<8;B+=2)
if(arr[(A*8+B)/2]==1)
cur+=(1<<B),cur+=(1<<(B+1));
else if(arr[(A*8+B)/2]==2)
cur+=(1<<B);
else if(arr[(A*8+B)/2]==3)
cur+=(1<<(B+1));
output(cur);
}
return ;
}
# | 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... |