# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
918164 | Elvin_Fritl | Easter Eggs (info1cup17_eastereggs) | C++17 | 15 ms | 5684 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
#define ll long long
const int N=2e5+5, mod=1e9+7;
int n;
#include "grader.h"
vector<int> d , g[N];
void dfs(int s,int p) {
d.push_back(s);
for(auto i: g[s]) {
if(i == p) {
continue;
}
dfs(i,s);
}
}
int findEgg(int M , vector<pair<int , int>> a) {
d.clear();
n = M;
for(int i=0;i<=n;i++) {
g[i].clear();
}
for(int i=0;i<(int)a.size();i++) {
g[a[i].first].push_back(a[i].second);
g[a[i].second].push_back(a[i].first);
}
dfs(1 , 0);
int l = 0 , r = n - 1 , best = 0;
while(l < r) {
int mid = (l + r)/2;
vector<int> q;
for(int i=0;i<=mid;i++) {
q.push_back(d[i]);
}
if(query(q) == 1) {
r = mid;
best = mid;
}
else {
l = mid + 1;
}
}
return d[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... |