
tarjan
coldfresh
那我们开始吧
展开
-
Proving Equivalences HDU - 2767(强连通)
Consider the following exercise, found in a generic linear algebra textbook. Let A be an n × n matrix. Prove that the following statements are equivalent: A is invertible. Ax = b has exactly one solu原创 2017-07-31 18:22:22 · 394 阅读 · 0 评论 -
FFF at Valentine HDU - 6165 (并查集+tarjan+缩点+拓扑排序)
At Valentine’s eve, Shylock and Lucar were enjoying their time as any other couples. Suddenly, LSH, Boss of FFF Group caught both of them, and locked them into two separate cells of the jail randomly.原创 2017-08-24 21:28:37 · 379 阅读 · 0 评论 -
Peaceful Commission HDU - 1814(2-SAT)
The Public Peace Commission should be legislated in Parliament of The Democratic Republic of Byteland according to The Very Important Law. Unfortunately one of the obstacles is the fact that some deput原创 2017-09-13 20:16:08 · 357 阅读 · 0 评论 -
Bomb HDU - 5934(tarjan)
There are N bombs needing exploding. Each bomb has three attributes: exploding radius riri, position (xi,yi)(xi,yi) and lighting-cost cici which means you need to pay cici cost making it explode. If a原创 2017-09-20 17:57:44 · 372 阅读 · 0 评论 -
【51nod】小k的技术(tarjan+带权并查集)
思路:用tarjan缩点以后,在带权并查集,需判断一个并查集里,是否含有强连通分量,如果有贡献就是点集大小,如果没有减1. 代码: #include<iostream> #include<cstdio> #include<algorithm> #include<cstring> #include<cmath> #defin...原创 2018-09-04 19:14:30 · 306 阅读 · 0 评论 -
【51nod】调查任务(tarjan+dp)
基准时间限制:4 秒 空间限制:524288 KB 分值: 80 lbn是战忽中心——一个绝密的军事组织的一个军官,今天他接到了一个紧急任务:调查敌国X国某些城市的经济情况。 X国有N个城市,由M条单向道路连接,其中S城是X国的首都。 每个城市i有一个发达指数a[i],我们定义城市i的经济状况为首都S到城市i任意一条路径上两个不同的城市x,y的a[x] mod a[y]的最大值。(x和y必须...原创 2018-09-03 16:55:50 · 291 阅读 · 0 评论 -
【CodeChef - CRYPCUR】Crypto Trading(二分套tarjan、拓扑排序)
AMRExchange is the latest cryptocurrency exchange that has become very popular among cryptocurrency traders. On AMRExchange, there are N cryptocurrencies - let us denote the ith currency by Ci. M pair...原创 2018-10-18 14:39:25 · 766 阅读 · 0 评论