# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
622444 | Hanksburger | Easter Eggs (info1cup17_eastereggs) | C++17 | 21 ms | 464 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "grader.h"
#include <bits/stdc++.h>
using namespace std;
vector<int> adj[515], vec, tmp;
void dfs(int x, int p)
{
vec.push_back(x);
for (int y:adj[x])
if (y!=p)
dfs(y, x);
}
int findEgg(int n, vector<pair<int, int> > edge)
{
for (int i=1; i<=n; i++)
adj[i].clear();
for (int i=0; i<edge.size(); i++)
{
int x=edge[i].first, y=edge[i].second;
adj[x].push_back(y);
adj[y].push_back(x);
}
vec.clear();
dfs(1, 1);
int l=0, r=n-1;
while (l<r)
{
int m=(l+r)/2;
tmp.clear();
for (int i=0; i<=m; i++)
tmp.push_back(vec[i]);
if (query(tmp))
r=m;
else
l=m+1;
}
return vec[l];
}
컴파일 시 표준 에러 (stderr) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |