#include <iostream>
#include <vector>
#include "minerals.h"
using namespace std;
//ifstream cin ("idk.in");
//ofstream cout ("idk.out");
const int N = 43005;
void solve(vector <int> v) {
if (v.size() == 2) {
Answer(v[0], v[1]);
return;
}
vector <int> aux_st, aux_dr;
int nr = v.size() / 4, x;
for (auto it : v) {
x = Query(it);
if (x > nr) {
x = Query(it);
aux_dr.push_back(it);
}
else aux_st.push_back(it);
}
for (auto it : aux_st)
Query(it);
solve(aux_st);
solve(aux_dr);
}
void Solve(int n) {
vector <int> aux(0);
for (int i = 1; i <= n + n; ++i)
aux.push_back(i);
solve(aux);
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
200 KB |
Output is correct |
2 |
Correct |
0 ms |
200 KB |
Output is correct |
3 |
Correct |
0 ms |
200 KB |
Output is correct |
4 |
Correct |
0 ms |
200 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
328 KB |
Output is correct |
2 |
Correct |
2 ms |
328 KB |
Output is correct |
3 |
Correct |
5 ms |
456 KB |
Output is correct |
4 |
Correct |
9 ms |
712 KB |
Output is correct |
5 |
Correct |
18 ms |
1308 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
200 KB |
Output is correct |
2 |
Correct |
0 ms |
200 KB |
Output is correct |
3 |
Correct |
0 ms |
200 KB |
Output is correct |
4 |
Correct |
0 ms |
200 KB |
Output is correct |
5 |
Correct |
1 ms |
328 KB |
Output is correct |
6 |
Correct |
2 ms |
328 KB |
Output is correct |
7 |
Correct |
5 ms |
456 KB |
Output is correct |
8 |
Correct |
9 ms |
712 KB |
Output is correct |
9 |
Correct |
18 ms |
1308 KB |
Output is correct |
10 |
Correct |
2 ms |
328 KB |
Output is correct |
11 |
Correct |
13 ms |
968 KB |
Output is correct |
12 |
Correct |
19 ms |
1352 KB |
Output is correct |
13 |
Correct |
15 ms |
1332 KB |
Output is correct |
14 |
Correct |
15 ms |
1224 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
200 KB |
Output is correct |
2 |
Correct |
0 ms |
200 KB |
Output is correct |
3 |
Correct |
0 ms |
200 KB |
Output is correct |
4 |
Correct |
0 ms |
200 KB |
Output is correct |
5 |
Correct |
1 ms |
328 KB |
Output is correct |
6 |
Correct |
2 ms |
328 KB |
Output is correct |
7 |
Correct |
5 ms |
456 KB |
Output is correct |
8 |
Correct |
9 ms |
712 KB |
Output is correct |
9 |
Correct |
18 ms |
1308 KB |
Output is correct |
10 |
Correct |
2 ms |
328 KB |
Output is correct |
11 |
Correct |
13 ms |
968 KB |
Output is correct |
12 |
Correct |
19 ms |
1352 KB |
Output is correct |
13 |
Correct |
15 ms |
1332 KB |
Output is correct |
14 |
Correct |
15 ms |
1224 KB |
Output is correct |
15 |
Incorrect |
31 ms |
3004 KB |
Wrong Answer [2] |
16 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
200 KB |
Output is correct |
2 |
Correct |
0 ms |
200 KB |
Output is correct |
3 |
Correct |
0 ms |
200 KB |
Output is correct |
4 |
Correct |
0 ms |
200 KB |
Output is correct |
5 |
Correct |
1 ms |
328 KB |
Output is correct |
6 |
Correct |
2 ms |
328 KB |
Output is correct |
7 |
Correct |
5 ms |
456 KB |
Output is correct |
8 |
Correct |
9 ms |
712 KB |
Output is correct |
9 |
Correct |
18 ms |
1308 KB |
Output is correct |
10 |
Correct |
2 ms |
328 KB |
Output is correct |
11 |
Correct |
13 ms |
968 KB |
Output is correct |
12 |
Correct |
19 ms |
1352 KB |
Output is correct |
13 |
Correct |
15 ms |
1332 KB |
Output is correct |
14 |
Correct |
15 ms |
1224 KB |
Output is correct |
15 |
Incorrect |
31 ms |
3004 KB |
Wrong Answer [2] |
16 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
200 KB |
Output is correct |
2 |
Correct |
0 ms |
200 KB |
Output is correct |
3 |
Correct |
0 ms |
200 KB |
Output is correct |
4 |
Correct |
0 ms |
200 KB |
Output is correct |
5 |
Correct |
1 ms |
328 KB |
Output is correct |
6 |
Correct |
2 ms |
328 KB |
Output is correct |
7 |
Correct |
5 ms |
456 KB |
Output is correct |
8 |
Correct |
9 ms |
712 KB |
Output is correct |
9 |
Correct |
18 ms |
1308 KB |
Output is correct |
10 |
Correct |
2 ms |
328 KB |
Output is correct |
11 |
Correct |
13 ms |
968 KB |
Output is correct |
12 |
Correct |
19 ms |
1352 KB |
Output is correct |
13 |
Correct |
15 ms |
1332 KB |
Output is correct |
14 |
Correct |
15 ms |
1224 KB |
Output is correct |
15 |
Incorrect |
31 ms |
3004 KB |
Wrong Answer [2] |
16 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
200 KB |
Output is correct |
2 |
Correct |
0 ms |
200 KB |
Output is correct |
3 |
Correct |
0 ms |
200 KB |
Output is correct |
4 |
Correct |
0 ms |
200 KB |
Output is correct |
5 |
Correct |
1 ms |
328 KB |
Output is correct |
6 |
Correct |
2 ms |
328 KB |
Output is correct |
7 |
Correct |
5 ms |
456 KB |
Output is correct |
8 |
Correct |
9 ms |
712 KB |
Output is correct |
9 |
Correct |
18 ms |
1308 KB |
Output is correct |
10 |
Correct |
2 ms |
328 KB |
Output is correct |
11 |
Correct |
13 ms |
968 KB |
Output is correct |
12 |
Correct |
19 ms |
1352 KB |
Output is correct |
13 |
Correct |
15 ms |
1332 KB |
Output is correct |
14 |
Correct |
15 ms |
1224 KB |
Output is correct |
15 |
Incorrect |
31 ms |
3004 KB |
Wrong Answer [2] |
16 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
200 KB |
Output is correct |
2 |
Correct |
0 ms |
200 KB |
Output is correct |
3 |
Correct |
0 ms |
200 KB |
Output is correct |
4 |
Correct |
0 ms |
200 KB |
Output is correct |
5 |
Correct |
1 ms |
328 KB |
Output is correct |
6 |
Correct |
2 ms |
328 KB |
Output is correct |
7 |
Correct |
5 ms |
456 KB |
Output is correct |
8 |
Correct |
9 ms |
712 KB |
Output is correct |
9 |
Correct |
18 ms |
1308 KB |
Output is correct |
10 |
Correct |
2 ms |
328 KB |
Output is correct |
11 |
Correct |
13 ms |
968 KB |
Output is correct |
12 |
Correct |
19 ms |
1352 KB |
Output is correct |
13 |
Correct |
15 ms |
1332 KB |
Output is correct |
14 |
Correct |
15 ms |
1224 KB |
Output is correct |
15 |
Incorrect |
31 ms |
3004 KB |
Wrong Answer [2] |
16 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
200 KB |
Output is correct |
2 |
Correct |
0 ms |
200 KB |
Output is correct |
3 |
Correct |
0 ms |
200 KB |
Output is correct |
4 |
Correct |
0 ms |
200 KB |
Output is correct |
5 |
Correct |
1 ms |
328 KB |
Output is correct |
6 |
Correct |
2 ms |
328 KB |
Output is correct |
7 |
Correct |
5 ms |
456 KB |
Output is correct |
8 |
Correct |
9 ms |
712 KB |
Output is correct |
9 |
Correct |
18 ms |
1308 KB |
Output is correct |
10 |
Correct |
2 ms |
328 KB |
Output is correct |
11 |
Correct |
13 ms |
968 KB |
Output is correct |
12 |
Correct |
19 ms |
1352 KB |
Output is correct |
13 |
Correct |
15 ms |
1332 KB |
Output is correct |
14 |
Correct |
15 ms |
1224 KB |
Output is correct |
15 |
Incorrect |
31 ms |
3004 KB |
Wrong Answer [2] |
16 |
Halted |
0 ms |
0 KB |
- |