# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1051722 | user736482 | Parrots (IOI11_parrots) | C++17 | 0 ms | 0 KiB |
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[256];
void encode(int n,int v[]){
for(int i=0;i<n;i++){
for(int j=0;j<8;j++){
if(v[i]&(1<<j)){
// cout<<(2*(7-j+8*i)+(1));
//enc[7-j+8*i]=(2*(7-j+8*i)+(1));}
send(2*(7-j+8*i)+(1));
else{
//cout<<2*(7-j+8*i);
//enc[(7-j+8*i)]=2*(7-j+8*i);}
send(2*(7-j+8*i);
//cout<<" ";
}
}
}
#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);
for(int i=0;i<n;i++){
int k=0;
for(int j=0;j<8;j++){
k*=2;
if(v[j+8*i]%2==1) k++;
}
//cout<<k<<" ";
send(k);
}
}