# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
723988 | stevancv | Easter Eggs (info1cup17_eastereggs) | C++14 | 23 ms | 368 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
#include "grader.h"
#define ll long long
#define ld long double
#define sp ' '
#define en '\n'
#define smin(a, b) a = min(a, b)
#define smax(a, b) a = max(a, b)
using namespace std;
const int N = 600 + 2;
const int inf = 1e9;
vector<int> g[N], order;
void Dfs(int s, int e) {
order.push_back(s);
for (int u : g[s]) {
if (u != e) Dfs(u, s);
}
}
int findEgg(int n, vector<pair<int, int>> e) {
order.clear();
for (int i = 1; i <= n; i++) g[i].clear();
for (auto u : e) {
g[u.first].push_back(u.second);
g[u.second].push_back(u.first);
}
Dfs(1, 0);
int l = 0, r = n - 1;
while (l < r) {
int mid = l + r >> 1;
vector<int> t;
for (int i = 0; i <= mid; i++) t.push_back(order[i]);
if (query(t)) r = mid;
else l = mid + 1;
}
return order[r];
}
컴파일 시 표준 에러 (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... |