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<bits/stdc++.h>
#include "decoder.h"
#include "decoderlib.h"
#include "encoder.h"
#include "encoderlib.h"
using namespace std;
//int enc[2137];
void encode(int n,int v[]){
for(int i=0;i<n;i++){
for(int j=0;j<3;j++){
for(int k=0;k<(1<<j);k++){
//cout<<i*8+((v[i]/(1<<j*3))%8)<<" ";
//enc[(1<<j)-1+k+i*7]=i*8+((v[i]/(1<<j*3))%8);
send(i*8+((v[i]/(1<<j*3))%8));
}
}
//cout<<"\n";
}
}
#include<bits/stdc++.h>
#include "decoder.h"
#include "decoderlib.h"
#include "encoder.h"
#include "encoderlib.h"
using namespace std;
void decode(int n,int l,int v[]){
sort(v,v+l);
int pom[8];
for(int i=0;i<8;i++)
pom[i]=0;
for(int i=0;i<n;i++){
int k=0;
for(int j=0;j<7;j++){
pom[v[i*7+j]%8]++;
}
for(int j=0;j<8;j++){
if(pom[j]>=4){
k+=j;
pom[j]-=4;
}
}
for(int j=0;j<8;j++){
if(pom[j]>=2){
k*=8;
k+=j;
pom[j]-=2;
}
}
for(int j=0;j<8;j++){
if(pom[j]>=1){
k*=8;
k+=j;
pom[j]-=1;
}
}
output(k);
//cout<<k<<" ";
}
}
# | 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... |