#include <bits/stdc++.h>
#include "grader.h"
#ifndef EVAL
#include "grader.cpp"
#endif
using namespace std;
const int MAXN = 515;
vector<int> edges[MAXN];
int n;
int sz[MAXN];
vector<int> a;
void dfs(int u, int p = -1){
a.push_back(u);
for(auto v : edges[u]){
if(v == p)continue;
dfs(v,u);
}
}
int findEgg(int N, vector<pair<int,int>> bridges){
n = N;
for(auto [u, v] : bridges){
edges[u].push_back(v);
edges[v].push_back(u);
}dfs(1);
int l=0, r=n;
while(l+1 < r){
int mid = (l+r)>>1;
vector<int> toask;
for(int i=0;i<mid;i++){
toask.push_back(a[i]);
}if(query(toask))r = mid;
else l = mid;
}return a[l];
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
405 ms |
131076 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
293 ms |
131076 KB |
Execution killed with signal 9 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
286 ms |
131076 KB |
Execution killed with signal 9 |
2 |
Halted |
0 ms |
0 KB |
- |