2020-10-06から1日間の記事一覧

(コスト付き)木の直径(by dfs) 復元付き

yosupo judgeでAC https://judge.yosupo.jp/submission/25877 直径のパスも求められる // 木の直径(コストあり) struct TreeDiameter{ vector<vector<PII>> G; // (to, cost) ll N; ll start,end; VI path; ll d; VI TO; // 初期化のみ TreeDiameter(ll n){ N=n; G.res</vector<pii>…