Submission #918174

# Submission time Handle Problem Language Result Execution time Memory
918174 2024-01-29T13:22:15 Z Huseyn123 Easter Eggs (info1cup17_eastereggs) C++17
0 / 100
1 ms 500 KB
#include <bits/stdc++.h>
#include "grader.h"
using namespace std;
int cnt=0;
vector<vector<int>> g;
vector<int> a;
void dfs(int v,int prev){
	a.push_back(v);
	for(auto x:g[v]){
		if(x==prev){
			continue;
		}
		dfs(x,v);
	}
}
int findEgg (int N, vector < pair < int, int > > bridges)
{
	a.resize(N+1);
	g.resize(N+1);
	for(auto x:bridges){
		g[x.first].push_back(x.second); 
		g[x.second].push_back(x.first);
	}
	dfs(1,-1);
	int l=1,r=N; 
	while(l<r){
		int mid=(l+r)/2; 
		vector<int> b;
		for(int i=1;i<=mid;i++){
			b.push_back(i);
		}
		if(query(b)){
			r=mid; 
		}
		else{
			l=mid+1;
		}
	}
    return l;
}

# Verdict Execution time Memory Grader output
1 Runtime error 1 ms 436 KB Execution killed with signal 6
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 1 ms 464 KB Execution killed with signal 6
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 1 ms 500 KB Execution killed with signal 6
2 Halted 0 ms 0 KB -