#include <bits/stdc++.h>
#include "grader.h"
using namespace std;
vector<int>g[513];
vector<int>a;
void dfs(int node,int par)
{
a.push_back(node);
for(auto idx:g[node])
{
if(idx!=par)
dfs(idx,node);
}
}
int findEgg (int n, vector < pair < int, int > > b)
{
for(auto idx:b)
{
g[idx.first].push_back(idx.second);
g[idx.second].push_back(idx.first);
}
dfs(1,-1);
int l=0;
int r=n-1;
while(l<r)
{
int mid=l+(r-l)/2;
if(query(vector<int>(a.begin(),a.begin()+mid)))r=mid;
else
{
l=mid+1;
}
}
return a[l];
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Runtime error |
1 ms |
464 KB |
Execution killed with signal 6 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Runtime error |
201 ms |
131072 KB |
Execution killed with signal 9 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Runtime error |
193 ms |
131072 KB |
Execution killed with signal 9 |
2 |
Halted |
0 ms |
0 KB |
- |