#include <bits/stdc++.h>
#include "grader.h"
using namespace std;
using ll = long long;
vector<int> v[1010], l;
void dfs(int u, int p) {
l.push_back(u);
for(auto x : v[u]) if(x != p) dfs(x, u);
}
int findEgg(int N, vector<pair<int, int>> bridges) {
for(auto [x, y] : bridges) v[x].push_back(y), v[y].push_back(x);
dfs(1, 0);
int L = 0, R = N-2;
while(L <= R) {
int M = (L+R)/2;
if(query(vector<int>(l.begin(), l.begin()+M+1))) R = M-1;
else L = M+1;
}
return l[L];
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
268 ms |
131072 KB |
Execution killed with signal 9 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
192 ms |
131072 KB |
Execution killed with signal 9 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
203 ms |
131072 KB |
Execution killed with signal 9 |
2 |
Halted |
0 ms |
0 KB |
- |