#include <bits/stdc++.h>
#include "library.h"
using namespace std;
void Solve(int N){
int A[N+1];
for(int i=1;i<=N;i++)A[i] = 0;
vector<int>v;
for(int i=1;i<=N;i++)v.push_back(1);
vector<int>fin;
for(int i=1;i<=N;i++){
v[i-1] = 0;
int ans = Query(v);
if(ans == 1){fin.push_back(i), A[i-1] = 1; break;}
v[i-1] = 1;
}
for(int i=2;i<=N;i++){
int x = fin.back();
v.clear();
for(int i=0;i<N;i++)v.push_back(0);
v[x-1] = 1;
for(int j=1;j<=N;j++){
if(A[j])continue;
v[j-1] = 1;
int ans = Query(v);
if(ans == 1){fin.push_back(j), A[i-1] = 1; break;}
v[j-1] = 0;
}
}
Answer(fin);
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
243 ms |
284 KB |
Execution killed with signal 13 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
243 ms |
284 KB |
Execution killed with signal 13 |
2 |
Halted |
0 ms |
0 KB |
- |