#include "minerals.h"
#include<bits/stdc++.h>
using namespace std;
bitset<90000> on;
int uwusgi(int x) {
on.flip(x);
return Query(x);
}
#define Query uwusgi
void Solve(int N) {
vector<int> A, B, C(N);
for(int lst = 0, i = 1; i <= 2*N; i++) {
int cc = Query(i);
(cc==lst ? B : A).push_back(i);
lst = cc;
}
// int CC = 0;
for(int b = 0; b < 16; b++) {
int lst = 0;
for(int i = 0; i < N; i++)
if(((i>>b)&1)^on[A[i]])
lst = Query(A[i]);
for(int i = 0; i < N; i++) {
int qq = Query(B[i]);
C[i] |= (lst == qq)<<b;
lst = qq;
}
// for(auto i : C) cout << i << " "; cout << endl;
}
for(int i = 0; i < N; i++)
Answer(A[C[i]], B[i]);
}
# |
Verdict |
Execution time |
Memory |
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 |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
328 KB |
Output is correct |
2 |
Correct |
1 ms |
328 KB |
Output is correct |
3 |
Correct |
3 ms |
456 KB |
Output is correct |
4 |
Correct |
4 ms |
584 KB |
Output is correct |
5 |
Correct |
11 ms |
840 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
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 |
2 ms |
328 KB |
Output is correct |
6 |
Correct |
1 ms |
328 KB |
Output is correct |
7 |
Correct |
3 ms |
456 KB |
Output is correct |
8 |
Correct |
4 ms |
584 KB |
Output is correct |
9 |
Correct |
11 ms |
840 KB |
Output is correct |
10 |
Correct |
1 ms |
328 KB |
Output is correct |
11 |
Correct |
6 ms |
720 KB |
Output is correct |
12 |
Correct |
9 ms |
968 KB |
Output is correct |
13 |
Correct |
7 ms |
988 KB |
Output is correct |
14 |
Correct |
9 ms |
856 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
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 |
2 ms |
328 KB |
Output is correct |
6 |
Correct |
1 ms |
328 KB |
Output is correct |
7 |
Correct |
3 ms |
456 KB |
Output is correct |
8 |
Correct |
4 ms |
584 KB |
Output is correct |
9 |
Correct |
11 ms |
840 KB |
Output is correct |
10 |
Correct |
1 ms |
328 KB |
Output is correct |
11 |
Correct |
6 ms |
720 KB |
Output is correct |
12 |
Correct |
9 ms |
968 KB |
Output is correct |
13 |
Correct |
7 ms |
988 KB |
Output is correct |
14 |
Correct |
9 ms |
856 KB |
Output is correct |
15 |
Correct |
24 ms |
1992 KB |
Output is correct |
16 |
Correct |
24 ms |
1992 KB |
Output is correct |
17 |
Correct |
19 ms |
2108 KB |
Output is correct |
18 |
Correct |
22 ms |
1904 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
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 |
2 ms |
328 KB |
Output is correct |
6 |
Correct |
1 ms |
328 KB |
Output is correct |
7 |
Correct |
3 ms |
456 KB |
Output is correct |
8 |
Correct |
4 ms |
584 KB |
Output is correct |
9 |
Correct |
11 ms |
840 KB |
Output is correct |
10 |
Correct |
1 ms |
328 KB |
Output is correct |
11 |
Correct |
6 ms |
720 KB |
Output is correct |
12 |
Correct |
9 ms |
968 KB |
Output is correct |
13 |
Correct |
7 ms |
988 KB |
Output is correct |
14 |
Correct |
9 ms |
856 KB |
Output is correct |
15 |
Correct |
24 ms |
1992 KB |
Output is correct |
16 |
Correct |
24 ms |
1992 KB |
Output is correct |
17 |
Correct |
19 ms |
2108 KB |
Output is correct |
18 |
Correct |
22 ms |
1904 KB |
Output is correct |
19 |
Incorrect |
27 ms |
1864 KB |
Wrong Answer [2] |
20 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
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 |
2 ms |
328 KB |
Output is correct |
6 |
Correct |
1 ms |
328 KB |
Output is correct |
7 |
Correct |
3 ms |
456 KB |
Output is correct |
8 |
Correct |
4 ms |
584 KB |
Output is correct |
9 |
Correct |
11 ms |
840 KB |
Output is correct |
10 |
Correct |
1 ms |
328 KB |
Output is correct |
11 |
Correct |
6 ms |
720 KB |
Output is correct |
12 |
Correct |
9 ms |
968 KB |
Output is correct |
13 |
Correct |
7 ms |
988 KB |
Output is correct |
14 |
Correct |
9 ms |
856 KB |
Output is correct |
15 |
Correct |
24 ms |
1992 KB |
Output is correct |
16 |
Correct |
24 ms |
1992 KB |
Output is correct |
17 |
Correct |
19 ms |
2108 KB |
Output is correct |
18 |
Correct |
22 ms |
1904 KB |
Output is correct |
19 |
Incorrect |
27 ms |
1864 KB |
Wrong Answer [2] |
20 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
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 |
2 ms |
328 KB |
Output is correct |
6 |
Correct |
1 ms |
328 KB |
Output is correct |
7 |
Correct |
3 ms |
456 KB |
Output is correct |
8 |
Correct |
4 ms |
584 KB |
Output is correct |
9 |
Correct |
11 ms |
840 KB |
Output is correct |
10 |
Correct |
1 ms |
328 KB |
Output is correct |
11 |
Correct |
6 ms |
720 KB |
Output is correct |
12 |
Correct |
9 ms |
968 KB |
Output is correct |
13 |
Correct |
7 ms |
988 KB |
Output is correct |
14 |
Correct |
9 ms |
856 KB |
Output is correct |
15 |
Correct |
24 ms |
1992 KB |
Output is correct |
16 |
Correct |
24 ms |
1992 KB |
Output is correct |
17 |
Correct |
19 ms |
2108 KB |
Output is correct |
18 |
Correct |
22 ms |
1904 KB |
Output is correct |
19 |
Incorrect |
27 ms |
1864 KB |
Wrong Answer [2] |
20 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
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 |
2 ms |
328 KB |
Output is correct |
6 |
Correct |
1 ms |
328 KB |
Output is correct |
7 |
Correct |
3 ms |
456 KB |
Output is correct |
8 |
Correct |
4 ms |
584 KB |
Output is correct |
9 |
Correct |
11 ms |
840 KB |
Output is correct |
10 |
Correct |
1 ms |
328 KB |
Output is correct |
11 |
Correct |
6 ms |
720 KB |
Output is correct |
12 |
Correct |
9 ms |
968 KB |
Output is correct |
13 |
Correct |
7 ms |
988 KB |
Output is correct |
14 |
Correct |
9 ms |
856 KB |
Output is correct |
15 |
Correct |
24 ms |
1992 KB |
Output is correct |
16 |
Correct |
24 ms |
1992 KB |
Output is correct |
17 |
Correct |
19 ms |
2108 KB |
Output is correct |
18 |
Correct |
22 ms |
1904 KB |
Output is correct |
19 |
Incorrect |
27 ms |
1864 KB |
Wrong Answer [2] |
20 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
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 |
2 ms |
328 KB |
Output is correct |
6 |
Correct |
1 ms |
328 KB |
Output is correct |
7 |
Correct |
3 ms |
456 KB |
Output is correct |
8 |
Correct |
4 ms |
584 KB |
Output is correct |
9 |
Correct |
11 ms |
840 KB |
Output is correct |
10 |
Correct |
1 ms |
328 KB |
Output is correct |
11 |
Correct |
6 ms |
720 KB |
Output is correct |
12 |
Correct |
9 ms |
968 KB |
Output is correct |
13 |
Correct |
7 ms |
988 KB |
Output is correct |
14 |
Correct |
9 ms |
856 KB |
Output is correct |
15 |
Correct |
24 ms |
1992 KB |
Output is correct |
16 |
Correct |
24 ms |
1992 KB |
Output is correct |
17 |
Correct |
19 ms |
2108 KB |
Output is correct |
18 |
Correct |
22 ms |
1904 KB |
Output is correct |
19 |
Incorrect |
27 ms |
1864 KB |
Wrong Answer [2] |
20 |
Halted |
0 ms |
0 KB |
- |