#include "minerals.h"
#include<bits/stdc++.h>
using namespace std;
void solve(vector<int>A,vector<int>B){
if(A.size()==1) return Answer(A[0],B[0]);
vector<int>A1,A2;
vector<int>B1,B2;
for(auto i:A)
A1.push_back(i),swap(A1,A2);
int prv=0;
for(auto i:A1)
prv=Query(i);
for(auto i:B) {
int x=Query(i);
if(x==prv)
B2.push_back(i);
else B1.push_back(i);
prv=x;
}
for(auto i:A1)
Query(i);
for(auto i:B)
Query(i);
solve(A1,B1);
solve(A2,B2);
}
void Solve(int N) {
vector<int>A,B;
int prv=0;
for(int i=1;i<=2*N;i++)
if(Query(i)!=prv)
A.push_back(i),prv++;
else B.push_back(i);
solve(A,B);
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
344 KB |
Output is correct |
2 |
Correct |
0 ms |
344 KB |
Output is correct |
3 |
Correct |
0 ms |
344 KB |
Output is correct |
4 |
Correct |
0 ms |
344 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
344 KB |
Output is correct |
2 |
Correct |
2 ms |
344 KB |
Output is correct |
3 |
Correct |
3 ms |
720 KB |
Output is correct |
4 |
Correct |
6 ms |
856 KB |
Output is correct |
5 |
Correct |
11 ms |
1368 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
344 KB |
Output is correct |
2 |
Correct |
0 ms |
344 KB |
Output is correct |
3 |
Correct |
0 ms |
344 KB |
Output is correct |
4 |
Correct |
0 ms |
344 KB |
Output is correct |
5 |
Correct |
1 ms |
344 KB |
Output is correct |
6 |
Correct |
2 ms |
344 KB |
Output is correct |
7 |
Correct |
3 ms |
720 KB |
Output is correct |
8 |
Correct |
6 ms |
856 KB |
Output is correct |
9 |
Correct |
11 ms |
1368 KB |
Output is correct |
10 |
Correct |
2 ms |
344 KB |
Output is correct |
11 |
Correct |
8 ms |
1212 KB |
Output is correct |
12 |
Correct |
14 ms |
1368 KB |
Output is correct |
13 |
Correct |
12 ms |
1368 KB |
Output is correct |
14 |
Correct |
9 ms |
1484 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
344 KB |
Output is correct |
2 |
Correct |
0 ms |
344 KB |
Output is correct |
3 |
Correct |
0 ms |
344 KB |
Output is correct |
4 |
Correct |
0 ms |
344 KB |
Output is correct |
5 |
Correct |
1 ms |
344 KB |
Output is correct |
6 |
Correct |
2 ms |
344 KB |
Output is correct |
7 |
Correct |
3 ms |
720 KB |
Output is correct |
8 |
Correct |
6 ms |
856 KB |
Output is correct |
9 |
Correct |
11 ms |
1368 KB |
Output is correct |
10 |
Correct |
2 ms |
344 KB |
Output is correct |
11 |
Correct |
8 ms |
1212 KB |
Output is correct |
12 |
Correct |
14 ms |
1368 KB |
Output is correct |
13 |
Correct |
12 ms |
1368 KB |
Output is correct |
14 |
Correct |
9 ms |
1484 KB |
Output is correct |
15 |
Incorrect |
18 ms |
3160 KB |
Wrong Answer [2] |
16 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
344 KB |
Output is correct |
2 |
Correct |
0 ms |
344 KB |
Output is correct |
3 |
Correct |
0 ms |
344 KB |
Output is correct |
4 |
Correct |
0 ms |
344 KB |
Output is correct |
5 |
Correct |
1 ms |
344 KB |
Output is correct |
6 |
Correct |
2 ms |
344 KB |
Output is correct |
7 |
Correct |
3 ms |
720 KB |
Output is correct |
8 |
Correct |
6 ms |
856 KB |
Output is correct |
9 |
Correct |
11 ms |
1368 KB |
Output is correct |
10 |
Correct |
2 ms |
344 KB |
Output is correct |
11 |
Correct |
8 ms |
1212 KB |
Output is correct |
12 |
Correct |
14 ms |
1368 KB |
Output is correct |
13 |
Correct |
12 ms |
1368 KB |
Output is correct |
14 |
Correct |
9 ms |
1484 KB |
Output is correct |
15 |
Incorrect |
18 ms |
3160 KB |
Wrong Answer [2] |
16 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
344 KB |
Output is correct |
2 |
Correct |
0 ms |
344 KB |
Output is correct |
3 |
Correct |
0 ms |
344 KB |
Output is correct |
4 |
Correct |
0 ms |
344 KB |
Output is correct |
5 |
Correct |
1 ms |
344 KB |
Output is correct |
6 |
Correct |
2 ms |
344 KB |
Output is correct |
7 |
Correct |
3 ms |
720 KB |
Output is correct |
8 |
Correct |
6 ms |
856 KB |
Output is correct |
9 |
Correct |
11 ms |
1368 KB |
Output is correct |
10 |
Correct |
2 ms |
344 KB |
Output is correct |
11 |
Correct |
8 ms |
1212 KB |
Output is correct |
12 |
Correct |
14 ms |
1368 KB |
Output is correct |
13 |
Correct |
12 ms |
1368 KB |
Output is correct |
14 |
Correct |
9 ms |
1484 KB |
Output is correct |
15 |
Incorrect |
18 ms |
3160 KB |
Wrong Answer [2] |
16 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
344 KB |
Output is correct |
2 |
Correct |
0 ms |
344 KB |
Output is correct |
3 |
Correct |
0 ms |
344 KB |
Output is correct |
4 |
Correct |
0 ms |
344 KB |
Output is correct |
5 |
Correct |
1 ms |
344 KB |
Output is correct |
6 |
Correct |
2 ms |
344 KB |
Output is correct |
7 |
Correct |
3 ms |
720 KB |
Output is correct |
8 |
Correct |
6 ms |
856 KB |
Output is correct |
9 |
Correct |
11 ms |
1368 KB |
Output is correct |
10 |
Correct |
2 ms |
344 KB |
Output is correct |
11 |
Correct |
8 ms |
1212 KB |
Output is correct |
12 |
Correct |
14 ms |
1368 KB |
Output is correct |
13 |
Correct |
12 ms |
1368 KB |
Output is correct |
14 |
Correct |
9 ms |
1484 KB |
Output is correct |
15 |
Incorrect |
18 ms |
3160 KB |
Wrong Answer [2] |
16 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
344 KB |
Output is correct |
2 |
Correct |
0 ms |
344 KB |
Output is correct |
3 |
Correct |
0 ms |
344 KB |
Output is correct |
4 |
Correct |
0 ms |
344 KB |
Output is correct |
5 |
Correct |
1 ms |
344 KB |
Output is correct |
6 |
Correct |
2 ms |
344 KB |
Output is correct |
7 |
Correct |
3 ms |
720 KB |
Output is correct |
8 |
Correct |
6 ms |
856 KB |
Output is correct |
9 |
Correct |
11 ms |
1368 KB |
Output is correct |
10 |
Correct |
2 ms |
344 KB |
Output is correct |
11 |
Correct |
8 ms |
1212 KB |
Output is correct |
12 |
Correct |
14 ms |
1368 KB |
Output is correct |
13 |
Correct |
12 ms |
1368 KB |
Output is correct |
14 |
Correct |
9 ms |
1484 KB |
Output is correct |
15 |
Incorrect |
18 ms |
3160 KB |
Wrong Answer [2] |
16 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
344 KB |
Output is correct |
2 |
Correct |
0 ms |
344 KB |
Output is correct |
3 |
Correct |
0 ms |
344 KB |
Output is correct |
4 |
Correct |
0 ms |
344 KB |
Output is correct |
5 |
Correct |
1 ms |
344 KB |
Output is correct |
6 |
Correct |
2 ms |
344 KB |
Output is correct |
7 |
Correct |
3 ms |
720 KB |
Output is correct |
8 |
Correct |
6 ms |
856 KB |
Output is correct |
9 |
Correct |
11 ms |
1368 KB |
Output is correct |
10 |
Correct |
2 ms |
344 KB |
Output is correct |
11 |
Correct |
8 ms |
1212 KB |
Output is correct |
12 |
Correct |
14 ms |
1368 KB |
Output is correct |
13 |
Correct |
12 ms |
1368 KB |
Output is correct |
14 |
Correct |
9 ms |
1484 KB |
Output is correct |
15 |
Incorrect |
18 ms |
3160 KB |
Wrong Answer [2] |
16 |
Halted |
0 ms |
0 KB |
- |