#include"chameleon.h"
#include<iostream>
#include<vector>
#include<algorithm>
#define ep emplace
#define eb emplace_back
#define fi first
#define se second
#define all(x) (x).begin(),(x).end()
using namespace std;
typedef long long ll;
typedef pair<int,int>pi;
typedef pair<ll,ll>pl;
const int inf=1e9+7;
const ll INF=1e18;
void Solve(int N)
{
int n=N;
vector<int>pr(n*2+1,0);
for(int i=n*2;i>0;i--)
{
int s=i+1,e=n*2+1;
while(s<e)
{
int m=s+(e-s)/2;
{
vector<int>qv;
qv.eb(i);
for(int j=s;j<=m;j++)
qv.eb(j);
int exp=m-s+1;
for(int j=s;j<=m;j++)
if(pr[j]!=0&&pr[j]<=m)
exp--;
if(Query(qv)==exp)
e=m;
else
s=m+1;
}
}
if(s!=n*2+1)
pr[i]=s,Answer(i,s);
}
return;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
384 KB |
Output is correct |
2 |
Correct |
0 ms |
384 KB |
Output is correct |
3 |
Correct |
18 ms |
384 KB |
Output is correct |
4 |
Correct |
18 ms |
384 KB |
Output is correct |
5 |
Correct |
18 ms |
384 KB |
Output is correct |
6 |
Correct |
19 ms |
504 KB |
Output is correct |
7 |
Correct |
18 ms |
384 KB |
Output is correct |
8 |
Correct |
18 ms |
384 KB |
Output is correct |
9 |
Correct |
19 ms |
384 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
384 KB |
Output is correct |
2 |
Incorrect |
1 ms |
384 KB |
Wrong Answer [6] |
3 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
384 KB |
Output is correct |
2 |
Incorrect |
1 ms |
384 KB |
Wrong Answer [6] |
3 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
384 KB |
Output is correct |
2 |
Incorrect |
1 ms |
288 KB |
Wrong Answer [6] |
3 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
384 KB |
Output is correct |
2 |
Correct |
0 ms |
384 KB |
Output is correct |
3 |
Correct |
18 ms |
384 KB |
Output is correct |
4 |
Correct |
18 ms |
384 KB |
Output is correct |
5 |
Correct |
18 ms |
384 KB |
Output is correct |
6 |
Correct |
19 ms |
504 KB |
Output is correct |
7 |
Correct |
18 ms |
384 KB |
Output is correct |
8 |
Correct |
18 ms |
384 KB |
Output is correct |
9 |
Correct |
19 ms |
384 KB |
Output is correct |
10 |
Correct |
1 ms |
384 KB |
Output is correct |
11 |
Incorrect |
1 ms |
384 KB |
Wrong Answer [6] |
12 |
Halted |
0 ms |
0 KB |
- |