#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];
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Runtime error |
1 ms |
336 KB |
Execution killed with signal 11 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Runtime error |
1 ms |
464 KB |
Execution killed with signal 11 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Runtime error |
1 ms |
464 KB |
Execution killed with signal 11 |
2 |
Halted |
0 ms |
0 KB |
- |