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"communication.h"
void encode(int n, int x) {
send((x == 1));
send((x == 2));
send((x == 2));
send((x == 1));
}
std::pair<int, int> decode(int N) {
bool a = receive(), b = receive(), c = receive(), d = receive();
if(b == c) {
if(b) {
return {1, 2};
}
return {1, 3};
}
if(a == d) {
if(a) {
return {1, 2};
}
return {2, 3};
}
if(a == b) {
return {1, 2};
}
return {2, 3};
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |