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 "communication.h"
using namespace std;
#define INF 2000000000
#define INFLL 3000000000000000000LL
#define ll long long
map<pair<int,pair<long long,long long>>,int>ans1;
map<pair<int,pair<long long,long long>>,int>ans2;
void encode(int n,int x){
long long num1=0;
long long num2=0;
for(int i=0;i<50;i++){
num1<<=1;
num1+=send(1);
}
for(int i=0;i<50;i++){
num2<<=1;
num2+=send(1);
}
if(ans1[{n,{num1,num2}}])ans2[{n,{num1,num2}}]=x;
else ans1[{n,{num1,num2}}]=x;
}
pair<int,int>decode(int n){
long long num1=0;
long long num2=0;
for(int i=0;i<50;i++){
num1<<=1;
num1+=receive();
}
for(int i=0;i<50;i++){
num2<<=1;
num2+=receive();
}
return{ans2[{n,{num1,num2}}],ans1[{n,{num1,num2}}] };
return {ans2[{n,{num1,num2}}],ans1[{n,{num1,num2}}] };
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |