#include <bits/stdc++.h>
#include "library.h"
using namespace std;
typedef long long ll;
typedef vector<int>vi;
#define pb push_back
#define sz(v) (int)v.size()
#define all(x) begin(x),end(x)
#define FOR(i,a,b) for(int i=a; i<b; i++)
#define ROF(i,a,b) for(int i=b-1; i>=a; i--)
//----------------------
void Solve(int N){
vi adj[N];
FOR(i,0,N){
FOR(j,0,N) if(i!=j){
vi a(N,0); a[i]=a[j]=1;
if(Query(a)==1) adj[i].pb(j);
}
}
vi ans;
FOR(i,0,N) if(sz(adj[i])<=1){
int prev=-1,u=i;
while(1){
ans.pb(u+1);
int nxt=-1;
for(int v: adj[u]) if(v!=prev) nxt=v;
if(nxt==-1) break;
prev=u;
u=nxt;
}
break;
}
Answer(ans);
return;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
252 ms |
284 KB |
Execution killed with signal 13 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
252 ms |
284 KB |
Execution killed with signal 13 |
2 |
Halted |
0 ms |
0 KB |
- |