首页 > TAG信息列表 > USACO11DEC

P3037 [USACO11DEC]Simplifying the Farm G[最小生成树]

前言 \(Kruscal\)的进一步应用以及\(set\)去重应用,输入输出没翻译,练习一下英语水平吧(其实是懒得搞)(逃 题目描述 Farmer John has been taking an evening algorithms course at his local university, and he has just learned about minimum spanning trees. However, Farmer John

[USACO11DEC]牧草种植Grass Planting

题目描述 Farmer John has N barren pastures (2 <= N <= 100,000) connected by N-1 bidirectional roads, such that there is exactly one path between any two pastures. Bessie, a cow who loves her grazing time, often complains about how there is no grass on t

[USACO11DEC]牧草种植Grass Planting

题目描述 给出一棵n个节点的树,有m个操作,操作为将一条路径上的边权加一或询问某条边的权值。 输入输出样例 输入样例#1: 复制 4 6 1 4 2 4 3 4 P 2 3 P 1 3 Q 3 4 P 1 4 Q 2 4 Q 1 4 输出样例#1: 复制 2 1 2 【解题思路】【code】 1 // luogu-judger-enable-o2 2 #include <cst