#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 |
1 |
Incorrect |
48 ms |
268 KB |
Not correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
346 ms |
540 KB |
Not correct |
2 |
Halted |
0 ms |
0 KB |
- |