Submission #503556

# Submission time Handle Problem Language Result Execution time Memory
503556 2022-01-08T10:41:46 Z Koosha_mv Library (JOI18_library) C++14
0 / 100
420 ms 262144 KB
#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> 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 ;
		}
	}
}
# Verdict Execution time Memory Grader output
1 Runtime error 420 ms 262144 KB Execution killed with signal 9
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 420 ms 262144 KB Execution killed with signal 9
2 Halted 0 ms 0 KB -