#include <bits/stdc++.h>
#include <minerals.h>
using namespace std;
#define ll long long
// #define int ll
#define FOR(i, a, b) for (int i = (a); i < (b); i++)
#define REP(i, n) FOR(i, 0, n)
#define REP1(i, n) FOR(i, 1, n+1)
#define RREP(i, n) for (int i = (n)-1; i >= 0; i--)
#define RREP1(i, n) for (int i = (n); i >= 1; i--)
#define ALL(x) (x).begin(), (x).end()
#define SZ(x) (int)((x).size())
#define pb push_back
#define pii pair<int, int>
#define f first
#define s second
const ll maxn = 5e5+5;
const ll inf = (1ll<<60);
const ll mod = 1000992299;
void run(vector<int> &L, vector<int> &R){
if (SZ(L) == 1 && SZ(R) == 1){
Answer(L[0], R[0]);
return;
}
int mid = SZ(L)/2, b = 0, ret;
vector<int> lll, lr, rl, rr;
REP(i, mid){
Query(L[i]);
lll.pb(L[i]);
b++;
}
FOR(i, mid, SZ(L)){
rl.pb(L[i]);
}
REP(i, SZ(R)){
ret = Query(R[i]);
if (ret == b){
lr.pb(R[i]);
}
else rr.pb(R[i]);
Query(R[i]);
}
REP(i, mid){
Query(L[i]);
}
run(lll, lr);
run(rl, rr);
}
void Solve(int N){
vector<int> a, b;
//REP1(i, N) a.pb(i);
//FOR(i, N+1, 2*N+1) b.pb(i);
int ret;
REP1(i, 2*N){
ret = Query(i);
if (ret == 0) a.pb(i);
else {
b.pb(i);
Query(i);
}
}
REP(i, SZ(a)) Query(a[i]);
run(a, b);
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
137 ms |
262144 KB |
Execution killed with signal 9 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
141 ms |
262144 KB |
Execution killed with signal 9 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
137 ms |
262144 KB |
Execution killed with signal 9 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
137 ms |
262144 KB |
Execution killed with signal 9 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
137 ms |
262144 KB |
Execution killed with signal 9 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
137 ms |
262144 KB |
Execution killed with signal 9 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
137 ms |
262144 KB |
Execution killed with signal 9 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
137 ms |
262144 KB |
Execution killed with signal 9 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
137 ms |
262144 KB |
Execution killed with signal 9 |
2 |
Halted |
0 ms |
0 KB |
- |