이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#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... |