This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#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 |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |