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"
#include<bits/stdc++.h>
using namespace std;
void encode(int N, int X){
for(int j = 0; j < 2; ++j){
send(((1<<j)&X) > 0);
send(((1<<j)&X) > 0);
}
}
pair<int, int> decode(int N) {
int a = 0, b = 0;
int x[4];
for(int j = 0; j < 4; ++j) x[j] = receive();
if(x[0] == x[1]){
a += 1;
b += 1;
}else if(x[0] != x[1]){
a += 1;
}
if(x[2] == x[3]){
a += 2;
b += 2;
}else if(x[2] != x[3]){
b += 2;
}
if(x[0] != x[1] && x[2] != x[3]) a = b = 3;
return {a, b};
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |