# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
776214 | rxlfd314 | Easter Eggs (info1cup17_eastereggs) | C++17 | 16 ms | 376 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
#include "grader.h"
using namespace std;
int findEgg(int N, vector<pair<int, int>> B) {
vector<int> adj[N];
for (auto &[a, b] : B) {
adj[--a].push_back(--b);
adj[b].push_back(a);
}
int rtin[N], timer = 0;
function<void(int, int)> dfs = [&](int f, int pf) {
rtin[timer++] = f;
for (int nf : adj[f]) {
if (nf != pf) {
dfs(nf, f);
}
}
};
dfs(0, 0);
int lo = 0, hi = N-1;
while (lo < hi) {
int mid = lo + hi >> 1;
vector<int> vec;
for (int i = 0; i <= mid; i++) {
vec.push_back(rtin[i]+1);
}
query(vec) ? hi = mid : lo = mid + 1;
}
return rtin[lo] + 1;
}
컴파일 시 표준 에러 (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... |