# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
72334 | nvmdava | 꿈 (IOI13_dreaming) | C++17 | 0 ms | 0 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
//#include "dreaming.h"
#include <bits/stdc++.h>
using namespace std;
struct Path{
int to, cost;
Path(int _to, int _cost){
to = _to;
cost = _cost;
}
};
struct Node{
int p[20], d;
};
map<int, int> c[100001];
vector<Path> path[100001];
bool in[100001];
Node a[100001];
int mxdist, mxid;
int solo = 0;
void build(int v, int p){
in[v] = 1;
for(auto x : path[v]){
if(x.to == p) continue;
a[x.to].d = a[v].d + 1;
memset(a[x.to].p, -1, sizeof(a[x.to].p));
a[x.to].p[0] = v;
for(int i = 1; i < 20; i++){
int t = a[x.to].p[i - 1];