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 <bits/stdc++.h>
#include "icc.h"
using namespace std;
void run(int n) {
int cnt = 0;
while (cnt != n - 1) {
for (int bit = 0; bit < 7; bit++) {
vector<int> A;
vector<int> B;
for (int x = 1; x <= n; x++) {
bool on = (x >> bit) & 1;
(on ? A.push_back(x) : B.push_back(x));
}
if ((int) A.size() > 0 and (int) B.size() > 0) {
int a[(int) A.size()];
for (int i = 0; i < (int) A.size(); i++) {
a[i] = A[i];
}
int b[(int) B.size()];
for (int i = 0; i < (int) B.size(); i++) {
b[i] = B[i];
}
int ret = query((int) A.size(), (int) B.size(), a, b);
if (ret) {
for (int x : A) {
for (int y : B) {
int _a[] = {x};
int _b[] = {y};
ret = query(1, 1, _a, _b);
if (ret) {
cnt += 1;
setRoad(x, y);
}
}
}
}
}
}
}
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |