随笔分类 -  6-2-数据结构-并查集

摘要:1678: Log大侠 java 题目描述 atm参加了速算训练班,经过刻苦修炼,对以2为底的对数算得飞快,人称Log大侠。 一天,Log大侠的好友 drd 有一些整数序列需要变换,Log大侠正好施展法力... 变换的规则是: 对其某个子序列的每个整数变为: [log_2 (x) + 1] 其中 [ 阅读全文
posted @ 2019-05-18 16:55 yzm10 阅读(225) 评论(0) 推荐(0)
摘要:String Reconstruction Ivan had string s consisting of small English letters. However, his friend Julia decided to make fun of him and hid the string s 阅读全文
posted @ 2018-04-12 17:01 yzm10 阅读(303) 评论(0) 推荐(0)
摘要:L3-1 社交集群(30 分) 当你在社交网络平台注册时,一般总是被要求填写你的个人兴趣爱好,以便找到具有相同兴趣爱好的潜在的朋友。一个“社交集群”是指部分兴趣爱好相同的人的集合。你需要找出所有的社交集群。 输入格式: 输入在第一行给出一个正整数 N(≤1000),为社交网络平台注册的所有用户的人数 阅读全文
posted @ 2018-03-30 20:44 yzm10 阅读(523) 评论(0) 推荐(0)
摘要:地铁修建 试题编号: 201703-4 试题名称: 地铁修建 时间限制: 1.0s 内存限制: 256.0MB 问题描述: 问题描述 A市有n个交通枢纽,其中1号和n号非常重要,为了加强运输能力,A市决定在1号到n号枢纽间修建一条地铁。 地铁由很多段隧道组成,每段隧道连接两个交通枢纽。经过勘探,有m 阅读全文
posted @ 2017-09-16 16:25 yzm10 阅读(264) 评论(0) 推荐(0)
摘要:Mr. Kitayuta's Colorful Graph Mr. Kitayuta has just bought an undirected graph consisting of n vertices and medges. The vertices of the graph are numb 阅读全文
posted @ 2017-08-11 15:29 yzm10 阅读(290) 评论(0) 推荐(1)
摘要:Knight Tournament Hooray! Berl II, the king of Berland is making a knight tournament. The king has already sent the message to all knights in the king 阅读全文
posted @ 2017-07-23 21:25 yzm10 阅读(299) 评论(0) 推荐(0)
摘要:Almost Union-Find I hope you know the beautiful Union-Find structure. In this problem, you're to implement something similar, but not identical. The d 阅读全文
posted @ 2017-07-23 13:50 yzm10 阅读(242) 评论(0) 推荐(0)
摘要:Wireless Network An earthquake takes place in Southeast Asia. The ACM (Asia Cooperated Medical team) have set up a wireless network with the lap compu 阅读全文
posted @ 2017-07-23 11:49 yzm10 阅读(237) 评论(0) 推荐(0)
摘要:Restructuring Company Even the most successful company can go through a crisis period when you have to make a hard decision — to restructure, discard 阅读全文
posted @ 2017-07-20 21:06 yzm10 阅读(561) 评论(0) 推荐(0)
摘要:小希的迷宫 小希的迷宫 上次Gardon的迷宫城堡小希玩了很久(见Problem B),现在她也想设计一个迷宫让Gardon来走。但是她设计迷宫的思路不一样,首先她认为所有的通道都应该是双向连通的,就是说如果有一个通道连通了房间A和B,那么既可以通过它从房间A走到房间B,也可以通过它从房间B走到房间 阅读全文
posted @ 2017-07-19 13:17 yzm10 阅读(306) 评论(0) 推荐(0)
摘要:某省调查城镇交通状况,得到现有城镇道路统计表,表中列出了每条道路直接连通的城镇。省政府“畅通工程”的目标是使全省任何两个城镇间都可以实现交通(但不一定有直接的道路相连,只要互相间接通过道路可达即可)。问最少还需要建设多少条道路? Input测试输入包含若干测试用例。每个测试用例的第1行给出两个正整数 阅读全文
posted @ 2017-07-17 14:51 yzm10 阅读(140) 评论(0) 推荐(0)