#include <bits/stdc++.h>
using namespace std;
#define dbgv(v) cout<<#v<<" = "; f(i,0,v.size()) cout<<v[i]<<" "; cout<<endl
#define dbga(a,x,y) cout<<#a<<" = "; f(i,x,y) cout<<a[i]<<" "; cout<<endl
#define erorp(x) cout<<#x<<"={"<<(x.F)<<" , "<<x.S<<"}"<<endl
#define eror(x) cout<<#x<<'='<<(x)<<endl
#define f_(i,a,b) for(int i=a;i>=b;i--)
#define f(i,a,b) for(int i=a;i<b;i++)
#define nb(x) __builtin_popcount(x)
#define all(v) v.begin(),v.end()
#define bit(n,k) (((n)>>(k))&1)
#define Add(x,y) x=(x+y)%mod
#define maxm(a,b) a=max(a,b)
#define minm(a,b) a=min(a,b)
#define lst(x) x[x.size()-1]
#define sz(x) int(x.size())
#define mp make_pair
#define ll long long
#define pb push_back
#define S second
#define F first
#include "library.h"
const int N=1e6+99;
int n,t,a[N];
vector<int> res,g[N];
vector<pair<int,int> > ans;
void dfs(int u,int p){
res.pb(u+1);
for(auto v : g[u]){
if(u==v) continue ;
dfs(v,u);
}
}
/*int ask(int l,int r){
vector<int> v(n);
f(i,l,r+1) v[i]=1;
int res=r-l+1-Query(v);
for(auto p : ans){
if(l<=p.F && p.F<=r && l<=p.S && p.S<=r){
res--;
}
}
return res;
}*/
int ask(int u,int v){
vector<int> vec(n);
vec[u]=1,vec[v]=1;
return Query(vec);
}
void Solve(int n){
f(i,0,n){
f(j,i+1,n){
if(ask(i,j)==1){
g[i].pb(j);
g[j].pb(i);
}
}
}
f(i,0,n){
if(g[i].size()==1){
dfs(i,i);
Answer(res);
return ;
}
}
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
26 ms |
47944 KB |
Execution killed with signal 11 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
26 ms |
47944 KB |
Execution killed with signal 11 |
2 |
Halted |
0 ms |
0 KB |
- |