# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
351985 | juggernaut | Parrots (IOI11_parrots) | C++14 | 69 ms | 1448 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"encoder.h"
#include"encoderlib.h"
#include<bits/stdc++.h>
using namespace std;
void encode(int n,int a[]){
vector<int>best(n*15,0);
int sig;
for(int xr=0;xr<256;xr++){
vector<int>vec;
for(int i=0;i<n;i++){
int x=a[i]^xr;
for(int j=0;j<8;j++)
if(x>>j&1){
if(j%2==1)vec.push_back((i<<2)|(j>>1));
vec.push_back((i<<2)|(j>>1));
}
}
if(vec.size()<best.size())best=vec,sig=xr;
}
for(auto to:best)send(to);
for(int i=0;i<4;i++)send(sig);
}
#include"decoder.h"
#include"decoderlib.h"
#include<bits/stdc++.h>
using namespace std;
int res[64],counter[256];
void decode(int n,int m,int a[]){
for(int i=0;i<n;i++)res[i]=0;
for(int i=0;i<256;i++)counter[i]=0;
int mx=0,val;
for(int i=0;i<m;i++)
counter[a[i]]++;
for(int i=0;i<256;i++)if(counter[i]>mx)mx=counter[i],val=i;
mx=0;
for(int i=0;i<m;i++){
if(a[i]==val&&mx!=4){
mx++;
continue;
}
int data=a[i]&3;
res[a[i]>>2]+=(1<<(data<<1));
}
for(int i=0;i<n;i++)output(res[i]^val);
}
Compilation message (stderr)
# | 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... |