이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#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... |