# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
110505 | tjd229 | Easter Eggs (info1cup17_eastereggs) | C++14 | 27 ms | 384 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
//#include<vector>
//#include<queue>
//#include <set>
#include "grader.h"
#define pii pair<int,int>
using namespace std;
int p[513],d[513];
vector<int> order;
void dfs(int x,int from,vector<int> *edge) {
order.push_back(x);
p[x] = from;
for (auto nxt : edge[x]) {
if (nxt != from) {
d[nxt] = d[x] + 1;
dfs(nxt, x, edge);
}
}
}
void make_beauty(vector<int> &tree) {
set<pii > st;//depth,x
for (auto x : tree) {
st.insert({-d[x],x});
}
while (st.size() > 1) {
int depth = st.begin()->first;
while (st.begin()->first ==depth) {
int par = p[st.begin()->second];
if (st.find({ -d[par],par }) == st.end()) {
tree.push_back(par);
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |