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>
#define f first
#define s second
#define ent '\n';
using namespace std;
typedef long long ll;
const int mx=2e5+12;
void output(int b);
void send(int a);
int cnt[mx];
void encode(int n, int a[]){
mt19937 rnd(1349);
for(int i=0;i<n;i++){
send(a[i]);
for(int t=0;t<9;t++){
int x=rnd()%256;
send((a[i]^x));
}
}
}
#include <bits/stdc++.h>
#define f first
#define s second
#define ent '\n';
using namespace std;
typedef long long ll;
const int mx=2e5+12;
void output(int b);
void send(int a);
int cnt[mx];
void decode(int m, int n, int a[]){
sort(a,a+n);
for(int i=0;i<256;i++){
cnt[i]=0;
}
for(int i=0;i<n;i++){
cnt[a[i]]++;
}
mt19937 rnd(1349);
for(int i=0;i<m;i++){
vector<int> v;
for(int t=0;t<9;t++){
int x=rnd()%256;
v.push_back(x);
}
for(int x=0;x<=256;x++){
vector<int> t={x};
int mn=--cnt[x];
for(int y:v){
mn=min(mn,--cnt[(x^y)]);
t.push_back((x^y));
}
if(mn>=0){
output(x);
break;
}
for(int x:t){
cnt[x]++;
}
}
}
}
# | 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... |