Submission #722961

#TimeUsernameProblemLanguageResultExecution timeMemory
722961Erkinoff_MohammedFlight to the Ford (BOI22_communication)C++17
0 / 100
346 ms540 KiB
#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 timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...