# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
875784 | Aiperiii | Easter Eggs (info1cup17_eastereggs) | C++14 | 189 ms | 131072 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
#include "grader.h"
using namespace std;
vector <int> g[513];
vector <int> tin;
void dfs(int v,int p){
tin.push_back(v);
for(auto to : g[v]){
if(to!=p)dfs(to,v);
}
}
int findEgg (int N, vector < pair < int, int > > bridges)
{
for(int i=0;i<bridges.size();i++){
g[bridges[i].first].push_back(bridges[i].second);
g[bridges[i].second].push_back(bridges[i].first);
}
dfs(1,-1);
int l=0,r=N-1;
while(l<r){
int md=(l+r)/2;
vector <int> check;
for(int i=0;i<=md;i++)check.push_back(tin[i]);
if(query(check))r=md;
else l=md+1;
}
return tin[l];
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |