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;
void encode(int n,int a[]){
int xr=time(NULL)%256;
for(int i=0;i<n;i++){
a[i]^=xr;
while(a[i]>63)send((i<<2)|3),a[i]-=64;
while(a[i]>15)send((i<<2)|2),a[i]-=16;
while(a[i]>3)send((i<<2)|1),a[i]-=4;
while(a[i]>0)send((i<<2)|0),a[i]-=1;
}
}
#include"decoder.h"
#include"decoderlib.h"
#include<bits/stdc++.h>
using namespace std;
int res[64];
void decode(int n,int m,int a[]){
int xr=time(NULL)%256;
for(int i=0;i<n;i++)res[i]=0;
for(int i=0;i<m;i++){
int data=a[i]&3;
if(data==0)res[a[i]>>2]+=1;
if(data==1)res[a[i]>>2]+=4;
if(data==2)res[a[i]>>2]+=16;
if(data==3)res[a[i]>>2]+=64;
}
for(int i=0;i<n;i++)res[i]^=xr;
for(int i=0;i<n;i++)output(res[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... |