摘要: 求以1为根的生成树各个节点与根距离之和的最小值,各个节点与根的距离最小值可以用dij求出 保留的边的数量一定是n-1条 #include<bits/stdc++.h> using namespace std; typedef long long LL; typedef pair<LL,int> PL 阅读全文
posted @ 2022-05-24 20:43 xhy666 阅读(98) 评论(0) 推荐(0)
摘要: 找出三元组i,j,k(i<j<k,ai,aj,ak互不相等) 等价于找出ai,aj,ak(ai<aj<ak,i,j,k互不相等) #include<bits/stdc++.h> using namespace std; typedef long long LL; const int N = 2e5+ 阅读全文
posted @ 2022-05-24 18:50 xhy666 阅读(48) 评论(0) 推荐(0)