#include "minerals.h"
#include <bits/stdc++.h>
using namespace std;
int pre, cur;
void dnc(vector<int> x, vector<int> y, bool bx = true, bool by = true) {
if (x.size() == 1) {
if (bx) {
cur = Query(x[0]);
swap(cur, pre);
}
if (by) {
cur = Query(y[0]);
swap(cur, pre);
}
Answer(x[0], y[0]);
return;
}
cout << x.size() << " " << y.size() << endl;
int n = x.size(); int mid = n / 2;
vector<int> x1, x2;
for (int i = 0; i < mid; i++) x1.push_back(x[i]);
for (int i = mid; i < n; i++) x2.push_back(x[i]);
if (bx) {
for (int i = mid; i < n; i++) {
cur = Query(x[i]);
swap(pre, cur);
}
} else {
for (int i = 0; i < mid; i++) {
cur = Query(x[i]);
swap(pre, cur);
}
}
vector<int> v1, v2;
for (auto c : y) {
cur = Query(c);
swap(pre, cur);
if (pre != cur) {
v1.push_back(c);
} else {
v2.push_back(c);
}
}
dnc(x1, v2, true, !by);
dnc(x2, v1, false, !by);
}
void Solve(int N) {
vector<int> v1, v2;
for (int i = 1; i <= 2 * N; ++i) {
cur = Query(i);
swap(cur, pre);
if (cur != pre) {
v1.push_back(i);
} else {
v2.push_back(i);
}
}
dnc(v1, v2);
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
208 KB |
DO NOT PRINT ANYTHING TO STANDARD OUTPUT |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
1 ms |
336 KB |
Execution killed with signal 13 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
208 KB |
DO NOT PRINT ANYTHING TO STANDARD OUTPUT |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
208 KB |
DO NOT PRINT ANYTHING TO STANDARD OUTPUT |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
208 KB |
DO NOT PRINT ANYTHING TO STANDARD OUTPUT |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
208 KB |
DO NOT PRINT ANYTHING TO STANDARD OUTPUT |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
208 KB |
DO NOT PRINT ANYTHING TO STANDARD OUTPUT |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
208 KB |
DO NOT PRINT ANYTHING TO STANDARD OUTPUT |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
208 KB |
DO NOT PRINT ANYTHING TO STANDARD OUTPUT |
2 |
Halted |
0 ms |
0 KB |
- |