Submission #1064475

# Submission time Handle Problem Language Result Execution time Memory
1064475 2024-08-18T13:09:58 Z goduadzesaba Easter Eggs (info1cup17_eastereggs) C++17
0 / 100
202 ms 131072 KB
#include <bits/stdc++.h>
#include "grader.h"
using namespace std;
int n,l,r,md; vector <int> g[1000],a,b;
void dfs (int i,int p){
	a.push_back(i);
	for (int j:g[i]){
		if (j==p) continue;
		dfs(j,i);
	}
}
int findEgg (int N, vector < pair < int, int > > bridges){
	n=N;
	for (auto i:bridges){
		g[i.first].push_back(i.second);
		g[i.second].push_back(i.first);
	}
	dfs(1,0);
	l=0; r=n-1;
	while (l<r){
		md=(l+r)/2; b.clear();
		for (int i=0; i<=md; i++)
			b.push_back(a[i]);
		if (query(b)) r=md;
		else l=md+1;
	}
	return a[l];
}
# Verdict Execution time Memory Grader output
1 Runtime error 202 ms 131072 KB Execution killed with signal 9
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 179 ms 131072 KB Execution killed with signal 9
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 162 ms 131072 KB Execution killed with signal 9
2 Halted 0 ms 0 KB -