#include "chameleon.h"
#include<bits/stdc++.h>
namespace {
int n;
} // namespace
void Solve(int N) {
using namespace std;
n=N;
int B=31;
vector<bool> used(2*n+1);
int cnt=0;
while(cnt<n){
vector<int> vec;
for(int i=1;i<=2*n;i++){
if(used[i]) continue;
int sz=vec.size();
vec.push_back(i);
if(Query(vec)==sz){
vec.pop_back();
for(auto v:vec){
if(Query({v,i})==1){
//cout<<v<<' '<<i<<'\n';
Answer(v,i);
used[v]=used[i]=true;
cnt++;
}
}
}
else if((int)vec.size()>B) vec.pop_back();
}
}
}
# |
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 |
Incorrect |
16 ms |
444 KB |
Wrong Answer [3] |
4 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
344 KB |
Output is correct |
2 |
Incorrect |
1 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 |
1 ms |
344 KB |
Wrong Answer [6] |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
344 KB |
Output is correct |
2 |
Incorrect |
3 ms |
344 KB |
Wrong Answer [3] |
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 |
Incorrect |
16 ms |
444 KB |
Wrong Answer [3] |
4 |
Halted |
0 ms |
0 KB |
- |