This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include "bits/stdc++.h"
#include "communication.h"
using namespace std;
void encode(int N, int X) {
vector<int> a(2);
a[0] = X % 2;
a[1] = (X / 2) % 2;
for (int i = 0; i < 125; i++) {
send(a[0]);
send(a[1]);
}
}
std::pair<int, int> decode(int N) {
for (int i = 0; i < 124; i++) {
int now = receive();
now += receive() * 2;
if (now == 3) continue;
if (now == 0) return {1, 2};
if (now == 1) return {1, 3};
if (now == 2) return {2, 3};
}
return {3, 3};
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |