#include "minerals.h"
#include <bits/stdc++.h>
using namespace std;
void Solve(int N){
vector <int> x,y;
int prv=0;
for (int i=1; i<=2*N; i++){
int tp=Query(i);
if (tp==prv) y.push_back(i);
else x.push_back(i);
prv=tp;
}
int ans[N];
for (int i=0; i<N; i++) ans[i]=0;
for (int b=0; b<16; b++){
for (int i=0; i<N; i++){
int thsx=!!(i&(1<<b));
int lstx=0;
if (b) lstx=!!(i&(1<<(b-1)));
if (thsx!=lstx){
prv=Query(x[i]);
}
}
for (int i=0; i<N; i++){
int tp=Query(y[i]);
if (tp!=prv) ans[i]+=(1<<b);
prv=tp;
}
}
for (int i=0; i<N; i++) Answer(x[ans[i]],y[i]);
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
336 KB |
Output is correct |
2 |
Correct |
0 ms |
336 KB |
Output is correct |
3 |
Correct |
1 ms |
336 KB |
Output is correct |
4 |
Correct |
1 ms |
376 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
336 KB |
Output is correct |
2 |
Correct |
1 ms |
336 KB |
Output is correct |
3 |
Correct |
2 ms |
592 KB |
Output is correct |
4 |
Correct |
4 ms |
592 KB |
Output is correct |
5 |
Correct |
6 ms |
1044 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
336 KB |
Output is correct |
2 |
Correct |
0 ms |
336 KB |
Output is correct |
3 |
Correct |
1 ms |
336 KB |
Output is correct |
4 |
Correct |
1 ms |
376 KB |
Output is correct |
5 |
Correct |
1 ms |
336 KB |
Output is correct |
6 |
Correct |
1 ms |
336 KB |
Output is correct |
7 |
Correct |
2 ms |
592 KB |
Output is correct |
8 |
Correct |
4 ms |
592 KB |
Output is correct |
9 |
Correct |
6 ms |
1044 KB |
Output is correct |
10 |
Correct |
1 ms |
336 KB |
Output is correct |
11 |
Correct |
4 ms |
848 KB |
Output is correct |
12 |
Correct |
6 ms |
1104 KB |
Output is correct |
13 |
Correct |
5 ms |
1104 KB |
Output is correct |
14 |
Correct |
5 ms |
1044 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
336 KB |
Output is correct |
2 |
Correct |
0 ms |
336 KB |
Output is correct |
3 |
Correct |
1 ms |
336 KB |
Output is correct |
4 |
Correct |
1 ms |
376 KB |
Output is correct |
5 |
Correct |
1 ms |
336 KB |
Output is correct |
6 |
Correct |
1 ms |
336 KB |
Output is correct |
7 |
Correct |
2 ms |
592 KB |
Output is correct |
8 |
Correct |
4 ms |
592 KB |
Output is correct |
9 |
Correct |
6 ms |
1044 KB |
Output is correct |
10 |
Correct |
1 ms |
336 KB |
Output is correct |
11 |
Correct |
4 ms |
848 KB |
Output is correct |
12 |
Correct |
6 ms |
1104 KB |
Output is correct |
13 |
Correct |
5 ms |
1104 KB |
Output is correct |
14 |
Correct |
5 ms |
1044 KB |
Output is correct |
15 |
Correct |
16 ms |
2028 KB |
Output is correct |
16 |
Correct |
16 ms |
2128 KB |
Output is correct |
17 |
Correct |
11 ms |
2120 KB |
Output is correct |
18 |
Correct |
11 ms |
2128 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
336 KB |
Output is correct |
2 |
Correct |
0 ms |
336 KB |
Output is correct |
3 |
Correct |
1 ms |
336 KB |
Output is correct |
4 |
Correct |
1 ms |
376 KB |
Output is correct |
5 |
Correct |
1 ms |
336 KB |
Output is correct |
6 |
Correct |
1 ms |
336 KB |
Output is correct |
7 |
Correct |
2 ms |
592 KB |
Output is correct |
8 |
Correct |
4 ms |
592 KB |
Output is correct |
9 |
Correct |
6 ms |
1044 KB |
Output is correct |
10 |
Correct |
1 ms |
336 KB |
Output is correct |
11 |
Correct |
4 ms |
848 KB |
Output is correct |
12 |
Correct |
6 ms |
1104 KB |
Output is correct |
13 |
Correct |
5 ms |
1104 KB |
Output is correct |
14 |
Correct |
5 ms |
1044 KB |
Output is correct |
15 |
Correct |
16 ms |
2028 KB |
Output is correct |
16 |
Correct |
16 ms |
2128 KB |
Output is correct |
17 |
Correct |
11 ms |
2120 KB |
Output is correct |
18 |
Correct |
11 ms |
2128 KB |
Output is correct |
19 |
Incorrect |
15 ms |
1872 KB |
Wrong Answer [2] |
20 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
336 KB |
Output is correct |
2 |
Correct |
0 ms |
336 KB |
Output is correct |
3 |
Correct |
1 ms |
336 KB |
Output is correct |
4 |
Correct |
1 ms |
376 KB |
Output is correct |
5 |
Correct |
1 ms |
336 KB |
Output is correct |
6 |
Correct |
1 ms |
336 KB |
Output is correct |
7 |
Correct |
2 ms |
592 KB |
Output is correct |
8 |
Correct |
4 ms |
592 KB |
Output is correct |
9 |
Correct |
6 ms |
1044 KB |
Output is correct |
10 |
Correct |
1 ms |
336 KB |
Output is correct |
11 |
Correct |
4 ms |
848 KB |
Output is correct |
12 |
Correct |
6 ms |
1104 KB |
Output is correct |
13 |
Correct |
5 ms |
1104 KB |
Output is correct |
14 |
Correct |
5 ms |
1044 KB |
Output is correct |
15 |
Correct |
16 ms |
2028 KB |
Output is correct |
16 |
Correct |
16 ms |
2128 KB |
Output is correct |
17 |
Correct |
11 ms |
2120 KB |
Output is correct |
18 |
Correct |
11 ms |
2128 KB |
Output is correct |
19 |
Incorrect |
15 ms |
1872 KB |
Wrong Answer [2] |
20 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
336 KB |
Output is correct |
2 |
Correct |
0 ms |
336 KB |
Output is correct |
3 |
Correct |
1 ms |
336 KB |
Output is correct |
4 |
Correct |
1 ms |
376 KB |
Output is correct |
5 |
Correct |
1 ms |
336 KB |
Output is correct |
6 |
Correct |
1 ms |
336 KB |
Output is correct |
7 |
Correct |
2 ms |
592 KB |
Output is correct |
8 |
Correct |
4 ms |
592 KB |
Output is correct |
9 |
Correct |
6 ms |
1044 KB |
Output is correct |
10 |
Correct |
1 ms |
336 KB |
Output is correct |
11 |
Correct |
4 ms |
848 KB |
Output is correct |
12 |
Correct |
6 ms |
1104 KB |
Output is correct |
13 |
Correct |
5 ms |
1104 KB |
Output is correct |
14 |
Correct |
5 ms |
1044 KB |
Output is correct |
15 |
Correct |
16 ms |
2028 KB |
Output is correct |
16 |
Correct |
16 ms |
2128 KB |
Output is correct |
17 |
Correct |
11 ms |
2120 KB |
Output is correct |
18 |
Correct |
11 ms |
2128 KB |
Output is correct |
19 |
Incorrect |
15 ms |
1872 KB |
Wrong Answer [2] |
20 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
336 KB |
Output is correct |
2 |
Correct |
0 ms |
336 KB |
Output is correct |
3 |
Correct |
1 ms |
336 KB |
Output is correct |
4 |
Correct |
1 ms |
376 KB |
Output is correct |
5 |
Correct |
1 ms |
336 KB |
Output is correct |
6 |
Correct |
1 ms |
336 KB |
Output is correct |
7 |
Correct |
2 ms |
592 KB |
Output is correct |
8 |
Correct |
4 ms |
592 KB |
Output is correct |
9 |
Correct |
6 ms |
1044 KB |
Output is correct |
10 |
Correct |
1 ms |
336 KB |
Output is correct |
11 |
Correct |
4 ms |
848 KB |
Output is correct |
12 |
Correct |
6 ms |
1104 KB |
Output is correct |
13 |
Correct |
5 ms |
1104 KB |
Output is correct |
14 |
Correct |
5 ms |
1044 KB |
Output is correct |
15 |
Correct |
16 ms |
2028 KB |
Output is correct |
16 |
Correct |
16 ms |
2128 KB |
Output is correct |
17 |
Correct |
11 ms |
2120 KB |
Output is correct |
18 |
Correct |
11 ms |
2128 KB |
Output is correct |
19 |
Incorrect |
15 ms |
1872 KB |
Wrong Answer [2] |
20 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
336 KB |
Output is correct |
2 |
Correct |
0 ms |
336 KB |
Output is correct |
3 |
Correct |
1 ms |
336 KB |
Output is correct |
4 |
Correct |
1 ms |
376 KB |
Output is correct |
5 |
Correct |
1 ms |
336 KB |
Output is correct |
6 |
Correct |
1 ms |
336 KB |
Output is correct |
7 |
Correct |
2 ms |
592 KB |
Output is correct |
8 |
Correct |
4 ms |
592 KB |
Output is correct |
9 |
Correct |
6 ms |
1044 KB |
Output is correct |
10 |
Correct |
1 ms |
336 KB |
Output is correct |
11 |
Correct |
4 ms |
848 KB |
Output is correct |
12 |
Correct |
6 ms |
1104 KB |
Output is correct |
13 |
Correct |
5 ms |
1104 KB |
Output is correct |
14 |
Correct |
5 ms |
1044 KB |
Output is correct |
15 |
Correct |
16 ms |
2028 KB |
Output is correct |
16 |
Correct |
16 ms |
2128 KB |
Output is correct |
17 |
Correct |
11 ms |
2120 KB |
Output is correct |
18 |
Correct |
11 ms |
2128 KB |
Output is correct |
19 |
Incorrect |
15 ms |
1872 KB |
Wrong Answer [2] |
20 |
Halted |
0 ms |
0 KB |
- |