# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
908659 | GrandTiger1729 | Flight to the Ford (BOI22_communication) | C++17 | 2125 ms | 3184 KiB |
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)
{
int ans = 0;
vector<int> res[2];
int x = 0;
res[0].push_back(0);
int re[4]{};
bool f = 0;
for (int y = 1; y <= 29; y++)
{
if (1 << y > N)
{
break;
}
if (!f)
{
re[0] = send(X >> x & 1);
}
re[1] = send(X >> y & 1);
re[2] = send(X >> y & 1);
if (re[1] == re[2])
{
ans ^= re[1] << y;
f = 0;
continue;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |