摘要: 题目描述 如题,现在有一个并查集,你需要完成合并和查询操作。 输入输出格式 输入格式: 第一行包含两个整数N、M,表示共有N个元素和M个操作。 接下来M行,每行包含三个整数Zi、Xi、Yi 当Zi=1时,将Xi与Yi所在的集合合并 当Zi=2时,输出Xi与Yi是否在同一集合内,是的话输出Y;否则话输 阅读全文
posted @ 2017-08-14 20:34 Hammer_cwz_77 阅读(285) 评论(0) 推荐(2) 编辑
摘要: 题目描述 Like everyone else, FJ is always thinking up ways to increase his revenue. To this end, he has set up a series of tolls that the cows will pay wh 阅读全文
posted @ 2017-08-14 15:52 Hammer_cwz_77 阅读(459) 评论(1) 推荐(2) 编辑
摘要: 题目描述 Farmer John wants the cows to prepare for the county jumping competition, so Bessie and the gang are practicing jumping over hurdles. They are ge 阅读全文
posted @ 2017-08-14 11:41 Hammer_cwz_77 阅读(250) 评论(0) 推荐(1) 编辑
摘要: 题目背景 [Usaco2008 Jan] 题目描述 N (1 ≤ N ≤ 100) cows, conveniently numbered 1..N, are participating in a programming contest. As we all know, some cows code 阅读全文
posted @ 2017-08-14 09:35 Hammer_cwz_77 阅读(205) 评论(0) 推荐(1) 编辑
摘要: 题目描述 Farmer John is on a boat seeking fabled treasure on one of the N (1 <= N <= 100) islands conveniently labeled 1..N in the Cowribbean Sea. The tre 阅读全文
posted @ 2017-08-14 08:26 Hammer_cwz_77 阅读(251) 评论(0) 推荐(1) 编辑