Submission #823935

#TimeUsernameProblemLanguageResultExecution timeMemory
823935ttamxFlight to the Ford (BOI22_communication)C++17
0 / 100
1 ms292 KiB
#include"communication.h" #include<bits/stdc++.h> using namespace std; void encode(int N, int X){ vector<int> val={0,0,6,9,15}; for(int i=0;i<4;i++)send(val[X]>>i&1); } pair<int, int> decode(int N) { vector<vector<int>> vec(16); vector<int> val={0,0,6,9,15}; vector<int> res; for(int i=0;i<16;i++){ bool ok=true; for(int j=0;j<3;j++){ ok&=(i>>j&3)!=3; } if(ok){ res.emplace_back(i); } } int num=0; for(int i=0;i<4;i++)num|=receive()<<i; for(int i=1;i<=N;i++){ for(auto x:res){ vec[val[i]^x].emplace_back(i); } } return {vec[num][0],vec[num][1]}; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...