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