
图
文章平均质量分 80
bao___zi
ACM 弱鸡一枚
What this era lacks is not the person who is perfect but the person who is with virtue, justice, courage and compassion.
展开
-
Forsaken喜欢独一无二的树【最小生成树】
题目链接题目描述 众所周知,最小生成树是指使图中所有节点连通且边权和最小时的边权子集。 不过最小生成树太简单了,我们现在来思考一个稍微复杂一点的问题。 现在给定一个n个点,m条边的图,每条边eie_iei都有一个权值wiw_iwi 。定义删除一条边eie_iei 的代价为wiw_iwi ,并且你可以对这个图执行任意次删边操作。 设这个图的最小生成树权值和为sumsum,定义一个图的最小生成树是独一无二的当且仅当这个图的边集中没有除最小生成树外的其他子集能满足权值和为sum且使得所有点连通。原创 2022-05-23 10:11:39 · 218 阅读 · 0 评论 -
[USACO 2007 Ope S]Catch That Cow [DFS]
题目描述 Farmer John has been informed of the location of a fugitive cow and wants to catch her immediately. He starts at a point N (0 <= N <= 100,000) on a number line and the cow is at a point K (0 <= K <= 100,000) on the same number line. Farme原创 2022-05-02 12:01:24 · 367 阅读 · 0 评论 -
最短路【洛谷P4366】
最短路原创 2022-04-29 19:17:04 · 493 阅读 · 0 评论 -
Wannafly 2018年全国多校算法寒假训练营练习比赛(第四场) G 老子的意大利炮昵
链接题目描述 自攻打过太原县城以后,李云龙这意大利炮就使用的越发的顺手了,指哪打哪也是绝不含糊,于是小野队长开始疯狂打击独立团炮兵营,为了锻炼士兵移动意大利炮的能力,李团长开始给炮兵营进行特训,众(wo)所(xia)周(bian)知(de),意大利炮可由炮管,车轮,炮弹三部分组成,现在李团长在洋村设立阵地,分别把炮管,车轮,炮弹放在三个不同的地方,每一部分的重量不同,所以运输的速度也不相同。团长...原创 2018-03-12 23:41:42 · 1876 阅读 · 0 评论 -
关于强连通分量的一些小知识(未更完)
1.割点:通俗的说就是你把这个点去掉之后,强连通分量会增多,判断条件是 low[v]>=dfn[u];2.桥:你把这条边去掉后,强连通分量会增多,判断条件是low[v]>dfn[u];3.无向图:即图的边没有方向 有向图:图的边有方向完全图:图的每两个顶点之间有边链接 连通图:图的每两个顶点之间有路径链接4:用n个点构造一个完全图,有向图有:n*(n-1)条边,无向图有:n*...原创 2018-05-16 22:13:06 · 821 阅读 · 0 评论 -
Codeforces 1009D Relatively Prime Graph
Let's call an undirected graph G=(V,E) relatively prime if and only if for each edge (v,u)∈E GCD(v,u)=1 (the greatest common divisor of v and u is 1). If there is no edge between some pair of vertice...原创 2018-08-18 00:49:41 · 210 阅读 · 0 评论 -
Codeforces 1005F Berland and the Shortest Paths
There are n cities in Berland. Some pairs of cities are connected by roads. All roads are bidirectional. Each road connects two different cities. There is at most one road between a pair of cities. Th...原创 2018-08-17 00:16:07 · 446 阅读 · 0 评论 -
Codeforces 1027D Mouse Hunt
Medicine faculty of Berland State University has just finished their admission campaign. As usual, about 80% of applicants are girls and majority of them are going to live in the university dormitory ...原创 2018-08-20 13:53:51 · 508 阅读 · 0 评论