#include <bits/stdc++.h>
#include "grader.h"
using namespace std;
vector<int> v;
vector<int> adj[550];
void dfs(int k,int pa){
v.push_back(k);
for(int j:adj[k]){
if(j==pa)continue;
dfs(j,k);
}
}
int findEgg (int n, vector<pair<int,int>> bridges)
{
for(auto [a,b]:bridges){
adj[a].push_back(b);
adj[b].push_back(a);
}
int l=0,r=n;
while(r-l>1){
int m=(l+r)>>1;
vector<int> a(v.begin(),v.begin()+m);
if(query(a)){
r=m;
}
else{
l=m;
}
}
return v[l];
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
1 ms |
336 KB |
Execution killed with signal 11 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
1 ms |
464 KB |
Execution killed with signal 11 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
1 ms |
464 KB |
Execution killed with signal 11 |
2 |
Halted |
0 ms |
0 KB |
- |