Submission #1323056

#TimeUsernameProblemLanguageResultExecution timeMemory
1323056NValchanovFlight to the Ford (BOI22_communication)C++20
0 / 100
8 ms2748 KiB
#include"communication.h" #include <vector> using namespace std; void encode(int N, int X) { if(X == 1) { send(0); send(0); send(0); send(0); } else if(X == 2) { send(1); send(0); send(0); send(1); } else { send(0); send(1); send(1); send(0); } } std::pair<int, int> decode(int N) { vector < int > v; v.push_back(receive()); v.push_back(receive()); v.push_back(receive()); v.push_back(receive()); if(v[1] == v[2]) { if(v[1] == 1) return {3, 3}; return {1, 2}; } if(v[0] == v[3]) { if(v[0] == 1) return {2, 2}; return {1, 1}; } if(v[0] == v[1]) return {2, 3}; return {1, 1}; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...