# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
419995 | Runtime_error_ | Easter Eggs (info1cup17_eastereggs) | C++14 | 21 ms | 472 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
#include "grader.h"
#define pb push_back
using namespace std;
const int inf = 1e3+9;
vector<int> DfsOrder,adj[inf];
void dfs(int u,int p){
DfsOrder.pb(u);
for(auto v:adj[u])
if(v != p)
dfs(v,u);
}
int findEgg (int n, vector < pair < int, int > > bridges)
{
for(int i=1;i<=n;i++)
adj[i].clear();
DfsOrder.clear();
for(auto o:bridges)
adj[o.first].pb(o.second),
adj[o.second].pb(o.first);
dfs(1,-1);
int l = 0,r = n-1;
while(r!=l){
int mid = (l+r)/2;
if(query(vector<int>(DfsOrder.begin(),DfsOrder.begin()+mid+1)))
r = mid;
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |