#include "chameleon.h"
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ii pair<ll,ll>
#define fi first
#define se second
#define endl '\n'
#define puf push_front
#define pof pop_front
#define pub push_back
#define pob pop_back
#define rep(x,s,e) for (auto x=s-(s>e);x!=e-(s>e);s<e?x++:x--)
#define all(x) (x).begin(),(x).end()
#define sz(x) (int) (x).size()
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
int n;
bool solved[1005];
void Solve(int N) {
n=N;
rep(x,0,n){
vector<int> v;
rep(y,1,2*n+1) if (!solved[y]) v.pub(y);
while (sz(v)!=2){
rep(x,0,sz(v)) swap(v[x],v[rng()%(x+1)]);
vector<int> l,r;
rep(x,0,sz(v)/2) l.pub(v[x]);
rep(x,sz(v)/2,sz(v)) r.pub(v[x]);
if (Query(l)!=sz(l)) v=l;
else if (Query(r)!=sz(r)) v=r;
}
solved[v[0]]=true;
solved[v[1]]=true;
Answer(v[0],v[1]);
}
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
200 KB |
Output is correct |
2 |
Correct |
0 ms |
200 KB |
Output is correct |
3 |
Correct |
37 ms |
328 KB |
Output is correct |
4 |
Correct |
40 ms |
328 KB |
Output is correct |
5 |
Correct |
37 ms |
328 KB |
Output is correct |
6 |
Correct |
37 ms |
328 KB |
Output is correct |
7 |
Correct |
37 ms |
328 KB |
Output is correct |
8 |
Correct |
37 ms |
328 KB |
Output is correct |
9 |
Correct |
37 ms |
328 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
200 KB |
Output is correct |
2 |
Incorrect |
0 ms |
200 KB |
Wrong Answer [6] |
3 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
200 KB |
Output is correct |
2 |
Incorrect |
0 ms |
200 KB |
Wrong Answer [6] |
3 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
200 KB |
Output is correct |
2 |
Incorrect |
1 ms |
348 KB |
Wrong Answer [6] |
3 |
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 |
37 ms |
328 KB |
Output is correct |
4 |
Correct |
40 ms |
328 KB |
Output is correct |
5 |
Correct |
37 ms |
328 KB |
Output is correct |
6 |
Correct |
37 ms |
328 KB |
Output is correct |
7 |
Correct |
37 ms |
328 KB |
Output is correct |
8 |
Correct |
37 ms |
328 KB |
Output is correct |
9 |
Correct |
37 ms |
328 KB |
Output is correct |
10 |
Correct |
0 ms |
200 KB |
Output is correct |
11 |
Incorrect |
0 ms |
200 KB |
Wrong Answer [6] |
12 |
Halted |
0 ms |
0 KB |
- |