#include <bits/stdc++.h>
#include "grader.h"
#define pb push_back
#define fi first
#define se second
#define bw(i,r,l) for (int i=r-1;i>=l;i--)
#define fw(i,l,r) for (int i=l;i<r;i++)
#define fa(i,x) for (auto i:x)
using namespace std;
const int N=600;
vector<int> vec,G[N],ask;
void dfs(int u,int p) {
vec.pb(u);
fa (v,G[u]) if (v!=p) dfs(v,u);
}
int findEgg(int n,vector<pair<int,int>> bridges) {
fa (i,bridges) {
G[i.fi].pb(i.se);
G[i.se].pb(i.fi);
}
dfs(1,0);
int l=0,r=n-1;
while (l<r) {
int mid=(l+r)/2;
ask.clear();
fw (i,l,mid+1) ask.pb(vec[i]);
if (query(ask)) r=mid;
else l=mid+1;
}
return vec[l];
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
1053 ms |
131072 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
4 ms |
131072 KB |
Execution killed with signal 11 (could be triggered by violating memory limits) |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
1048 ms |
131072 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |