#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=2222;
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(v==p) 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> M(n);
M[u]=1,M[v]=1;
return Query(M);
}
void Solve(int _n){
n=_n;
f(i,0,n){
f(j,i+1,n){
vector<int> M(n);
M[i]=1,M[j]=1;
if(Query(M)==1){
g[i].pb(j);
g[j].pb(i);
}
}
}
f(i,0,n){
if(g[i].size()==1){
dfs(i,i);
Answer(res);
return ;
}
}
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
213 ms |
336 KB |
# of queries: 18336 |
2 |
Correct |
257 ms |
332 KB |
# of queries: 18145 |
3 |
Correct |
284 ms |
348 KB |
# of queries: 19900 |
4 |
Correct |
279 ms |
456 KB |
# of queries: 19900 |
5 |
Correct |
304 ms |
340 KB |
# of queries: 19900 |
6 |
Correct |
311 ms |
340 KB |
# of queries: 19900 |
7 |
Correct |
320 ms |
332 KB |
# of queries: 19900 |
8 |
Correct |
272 ms |
328 KB |
# of queries: 18528 |
9 |
Correct |
262 ms |
336 KB |
# of queries: 19701 |
10 |
Correct |
127 ms |
328 KB |
# of queries: 8256 |
11 |
Incorrect |
0 ms |
328 KB |
Wrong Answer [7] |
12 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
213 ms |
336 KB |
# of queries: 18336 |
2 |
Correct |
257 ms |
332 KB |
# of queries: 18145 |
3 |
Correct |
284 ms |
348 KB |
# of queries: 19900 |
4 |
Correct |
279 ms |
456 KB |
# of queries: 19900 |
5 |
Correct |
304 ms |
340 KB |
# of queries: 19900 |
6 |
Correct |
311 ms |
340 KB |
# of queries: 19900 |
7 |
Correct |
320 ms |
332 KB |
# of queries: 19900 |
8 |
Correct |
272 ms |
328 KB |
# of queries: 18528 |
9 |
Correct |
262 ms |
336 KB |
# of queries: 19701 |
10 |
Correct |
127 ms |
328 KB |
# of queries: 8256 |
11 |
Incorrect |
0 ms |
328 KB |
Wrong Answer [7] |
12 |
Halted |
0 ms |
0 KB |
- |