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 i = 0; i < 30; i++){
int t = (X >> i) & 1;
if (!send(t)) send(t);
}
}
pair<int, int> decode(int N) {
int res = 0;
for (int i = 0; i < 30; i++){
if (receive()) res |= 1 << i;
}
return make_pair(res, res);
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |