Submission #1099085

#TimeUsernameProblemLanguageResultExecution timeMemory
1099085LIAFlight to the Ford (BOI22_communication)C++17
0 / 100
4 ms332 KiB
#include "communication.h" #include<bits/stdc++.h> using namespace std; typedef long long ll; typedef pair <ll, ll> pll; typedef vector <ll> vll; typedef vector <pll> vpll; typedef vector<vector<pll>> vvpll; typedef vector <vector<ll>> vvll; typedef vector<bool> vb; typedef vector <vector<bool>> vvb; const ll inf = 1e9 + 7; using namespace std; typedef long long ll; void encode(int N, int X) { if (N == 3) { if (X == 1) { send(0); send(0); } else if (X == 2) { send(0); send(1); } else if (X == 3) { send(1); send(1); } } } pair<int, int> decode(int N) { vector<int> signals; for (int i = 0; i < 2; ++i) { signals.push_back(receive()); } if (signals[0] == 0 && signals[1] == 0) { return {1, 2}; } else if (signals[0] == 0 && signals[1] == 1) { return {2, 3}; } else if (signals[0] == 1 && signals[1] == 0) { return {1, 3}; } else { return {3, 2}; } }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...