#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 = 1, R = N-1;
while(L <= R) {
int M = (L+R)/2;
if(query(vector<int>(l.begin(), l.begin()+M+1))) L = M+1;
else R = M-1;
}
return l[R];
}
# |
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 |
208 ms |
131072 KB |
Execution killed with signal 9 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
194 ms |
131072 KB |
Execution killed with signal 9 |
2 |
Halted |
0 ms |
0 KB |
- |