#include <cstdio>
#include <vector>
#include "library.h"
using namespace std;
vector<int> al[209];
void Solve(int N){
vector<int> M(N);
for (int i = 0; i < N; i++){
for (int j = 0; j < i; j++){
M[i] = 1;
M[j] = 1;
if (Query(M)==1){
al[i].push_back(j);
al[j].push_back(i);
}
}
}
int ed = 0;
while (al[ed].size()==2) ed++;
vector<int> ans(N);
ans[0] = ed;
if (N>1) ans[1] = al[ed][0];
for (int i = 2; i < N; i++){
if (al[ans[i-1]][0]==ans[i-2]) ans[i] = al[ans[i-1]][1];
else ans[i] = al[ans[i-1]][0];
}
for (int i = 0; i < N; i++){
ans[i]++;
}
Answer(ans);
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
260 ms |
504 KB |
Wrong Answer [6] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
260 ms |
504 KB |
Wrong Answer [6] |
2 |
Halted |
0 ms |
0 KB |
- |