
并查集
qzm777
听风吹像大海
展开
-
LeetCode每日打卡一题:990. 等式方程的可满足性
990. 等式方程的可满足性给定一个由表示变量之间关系的字符串方程组成的数组,每个字符串方程 equations[i] 的长度为 4,并采用两种不同的形式之一:“a==b” 或 “a!=b”。在这里,a 和 b 是小写字母(不一定不同),表示单字母变量名。只有当可以将整数分配给变量名,以便满足所有给定的方程时才返回 true,否则返回 false。示例 1:输入:[“a==b”,“b!=a”]输出:false解释:如果我们指定,a = 1 且 b = 1,那么可以满足第一个方程,但无法满足第二个原创 2020-06-08 13:17:37 · 383 阅读 · 0 评论 -
TZOJ 2815: Connect them
2815: Connect them 分享至QQ空间时间限制(普通/Java):1000MS/3000MS 内存限制:65536KByte总提交: 683 测试通过:182标题描述You have n computers numbered from 1 to n and you want to connect them to make a small local area network (LAN). All connections are two-way (that原创 2020-05-19 08:56:12 · 425 阅读 · 0 评论 -
USACO Oct 2008 Watering Hole
描述Farmer John has decided to bring water to his N (1 <= N <= 300) pastures which are conveniently numbered 1…N. He may bring water to a pasture either by building a well in that pasture or conn...原创 2019-12-11 21:58:44 · 282 阅读 · 0 评论 -
Highways
描述The island nation of Flatopia is perfectly flat. Unfortunately, Flatopia has no public highways. So the traffic is difficult in Flatopia. The Flatopian government is aware of this problem. They’re ...原创 2019-12-11 17:47:39 · 188 阅读 · 0 评论