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 "library.h"
#include <bits/stdc++.h>
using namespace std;
#define pb push_back
void Solve(int n){
vector <int> ans, us(n);
int lst = -1;
for ( int x = 0; x < n; x++ ){
vector <int> t, e;
for ( int i = 0; i < n; i++ ){
if ( !us[i] ) t.pb(i);
else e.pb(i);
}
if ( x + 1 == n ){
ans.pb(t[0] + 1);
break;
}
vector <int> M(n);
for ( auto &u: t ) M[u] = 1;
for ( auto &j: t ){
if ( j == lst ) continue;
M[j] = 0;
if ( Query(M) == 1 ){
if ( lst == -1 ){
lst = j;
} else{
ans.pb(j + 1);
us[j] = 1;
}
}
M[j] = 1;
}
}
Answer(ans);
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |