#include "chameleon.h"
#include <vector>
#include<bits/stdc++.h>
using namespace std;
int n;
int vis[2010];
void clc(int l,int r,int &a,int &b){
vector<int>vc;
for(int i=l;i<=r;i++){
if(vis[i]){continue;}
vc.push_back(i);
}
if(vc.size()==0){
a=0;
b=0;return;
}
a=vc.size();b=Query(vc);
}
void Solve(int N) {
n=N;
int tc=n;
while(tc--){
int l=1;int r=n*2;
while(l<r){
int mi=l+(r-l)/2;
int a;int b;
clc(1,mi,a,b);
if(a!=b){
r=mi;
}else{
l=mi+1;
}
}
l=1;
int R=r;
while(l<r){
int mi=l+(r-l+1)/2;
int a;int b;
clc(mi,R,a,b);
if(a!=b){
l=mi;
}else{
r=mi-1;
}
}
Answer(l,R);
vis[l]=1;vis[R]=1;
}
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
344 KB |
Output is correct |
2 |
Correct |
0 ms |
344 KB |
Output is correct |
3 |
Correct |
28 ms |
344 KB |
Output is correct |
4 |
Correct |
28 ms |
596 KB |
Output is correct |
5 |
Correct |
28 ms |
344 KB |
Output is correct |
6 |
Correct |
27 ms |
344 KB |
Output is correct |
7 |
Correct |
31 ms |
456 KB |
Output is correct |
8 |
Correct |
30 ms |
344 KB |
Output is correct |
9 |
Correct |
28 ms |
344 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
344 KB |
Output is correct |
2 |
Incorrect |
0 ms |
344 KB |
Wrong Answer [6] |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
344 KB |
Output is correct |
2 |
Incorrect |
0 ms |
344 KB |
Wrong Answer [6] |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
344 KB |
Output is correct |
2 |
Incorrect |
0 ms |
344 KB |
Wrong Answer [6] |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
344 KB |
Output is correct |
2 |
Correct |
0 ms |
344 KB |
Output is correct |
3 |
Correct |
28 ms |
344 KB |
Output is correct |
4 |
Correct |
28 ms |
596 KB |
Output is correct |
5 |
Correct |
28 ms |
344 KB |
Output is correct |
6 |
Correct |
27 ms |
344 KB |
Output is correct |
7 |
Correct |
31 ms |
456 KB |
Output is correct |
8 |
Correct |
30 ms |
344 KB |
Output is correct |
9 |
Correct |
28 ms |
344 KB |
Output is correct |
10 |
Correct |
0 ms |
344 KB |
Output is correct |
11 |
Incorrect |
0 ms |
344 KB |
Wrong Answer [6] |
12 |
Halted |
0 ms |
0 KB |
- |