#include "chameleon.h"
#include <bits/stdc++.h>
using namespace std;
//#define int long long
#define ii pair<int,int>
typedef vector<int> vi;
#define iii tuple<int,int,int>
typedef vector<ii> vii;
typedef vector<iii> viii;
typedef map<int,int> mii;
#ifndef debug
#define cerr if (0) cerr
#endif
void Solve(int N) {
vector<int> V;
for(int i=1; i<=2*N; i++){
V.push_back(i);
}
while(!V.empty()){
int L=0, R=V.size(), M, a, b;
while(R>L+1){
M = (L+R)/2;
a = Query(vector(V.begin(),V.begin()+M));
b = Query(vector(V.begin()+1,V.begin()+M));
if (a==b) R = M;
else L = M;
}
a = V[0]; b = V[L];
V.erase(V.begin());V.erase(V.begin()+L-1);
Answer(a,b);
}
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
344 KB |
Output is correct |
2 |
Correct |
0 ms |
344 KB |
Output is correct |
3 |
Correct |
17 ms |
344 KB |
Output is correct |
4 |
Correct |
17 ms |
472 KB |
Output is correct |
5 |
Correct |
18 ms |
344 KB |
Output is correct |
6 |
Correct |
17 ms |
492 KB |
Output is correct |
7 |
Correct |
17 ms |
344 KB |
Output is correct |
8 |
Correct |
18 ms |
468 KB |
Output is correct |
9 |
Correct |
18 ms |
344 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
344 KB |
Output is correct |
2 |
Incorrect |
0 ms |
344 KB |
Wrong Answer [6] |
3 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
344 KB |
Output is correct |
2 |
Incorrect |
0 ms |
344 KB |
Wrong Answer [6] |
3 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
340 KB |
Output is correct |
2 |
Incorrect |
1 ms |
344 KB |
Wrong Answer [6] |
3 |
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 |
17 ms |
344 KB |
Output is correct |
4 |
Correct |
17 ms |
472 KB |
Output is correct |
5 |
Correct |
18 ms |
344 KB |
Output is correct |
6 |
Correct |
17 ms |
492 KB |
Output is correct |
7 |
Correct |
17 ms |
344 KB |
Output is correct |
8 |
Correct |
18 ms |
468 KB |
Output is correct |
9 |
Correct |
18 ms |
344 KB |
Output is correct |
10 |
Correct |
1 ms |
344 KB |
Output is correct |
11 |
Incorrect |
0 ms |
344 KB |
Wrong Answer [6] |
12 |
Halted |
0 ms |
0 KB |
- |