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 m[])
{
int bit=0;
for(int i=0;i<n;i++){
for(int j=0;j<8;j++){
if((m[i]^i)&(1<<j)){
bit++;
}
send(bit);
}
}
// cout<<bit<<endl;
}
#include "decoder.h"
#include "decoderlib.h"
#include <bits/stdc++.h>
using namespace std;
void decode(int n, int l, int bit[])
{
sort(bit,bit+l);
int ind=0;
for(int i=0;i<l;i+=8){
int res=0;
for(int j=i;j<i+8;j++){
if(j==0){
res+=bit[i];
}else{
if(bit[j] - bit[j-1]){
res+=(1<<(j-i));
}
}
}
output((res^ind));
// cout<<(res^ind)<<'\n';
ind++;
}
}
# | 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... |