# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
900566 | JakobZorz | 꿈 (IOI13_dreaming) | C++17 | 0 ms | 0 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include"dreaming.h"
#include<iostream>
#include<vector>
#include<algorithm>
#include<map>
using namespace std;
typedef long long ll;
vector<pair<ll,ll>>nodes[100000];
bool vis[100000];
vector<ll>node_list;
void dfs(ll node){
if(vis[node])
return;
vis[node]=true;
node_list.push_back(node);
for(auto ne:nodes[node])
dfs(ne.first);
}
map<pair<ll,ll>,ll>dp;
ll get_max_dist(ll node,ll prev){
if(dp.count({node,prev}))
return dp[{node,prev}];
ll res=0;
for(auto ne:nodes[node]){
if(ne.first==prev)
continue;