首页 >
头像 黄学骏
发表于 2022-08-05 15:00:14
#include <bits/stdc++.h> using namespace std; const int N = 1e6+10, M = N*2; typedef pair<int,int> PII; int n,p,k; int e[M],ne[M],h[N] 展开全文
头像 小琢卷不动
发表于 2021-11-23 14:56:49
输入的是一个树的结构,她的家在 PPP 点,就以 PPP 为根,dfs 求出每个点到 PPP 的距离 dis\text{dis}dis,然后以 dis\text{dis}dis 来排序,找到离她家第 KKK 远的点即可。 求距离的时候可以用到公式:(假如 uuu 是一个结点,vvv 是 uuu 的孩 展开全文
头像 ppco
发表于 2021-11-07 13:10:40
#include <bits/stdc++.h> using namespace std; int n,p,k; const int maxn=200005; const int inf=0x3f3f3f3f; struct node { int v; int w; node(int v 展开全文
头像 黑眼圈z
发表于 2023-07-30 15:53:26
题目链接:https://ac.nowcoder.com/acm/problem/15522 就是一道很常规的dijskstra题,虽然我自己debug 疯了(丢脸>_<) #include<bits/stdc++.h> using namespace std; const 展开全文