#include <bits/stdc++.h>
#include "grader.h"
using namespace std;
#define ff first
#define ss second
const int mxN=513;
vector<int> v[mxN],o;
void dfs(int a, int p){
o.push_back(a);
for(auto node: v[a]){
if(node!=p){
dfs(node,a);
}
}
}
int findEgg(int N, vector<pair<int,int> > bridges){
for(auto p: bridges){
v[p.ff].push_back(p.ss);
v[p.ss].push_back(p.ff);
}
dfs(1,1);
int l=1,r=N;
while(l<=r){
int m=l+(r-l)/2;
vector<int> c(m);
for(int i=0; i<m; i++) c[i]=o[i];
if(query(c)) r=m-1;
else l=m+1;
}
return o[l];
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
1 ms |
456 KB |
Execution killed with signal 6 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
184 ms |
131072 KB |
Execution killed with signal 9 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
154 ms |
131072 KB |
Execution killed with signal 9 |
2 |
Halted |
0 ms |
0 KB |
- |