并查集
星星的泪痕
这个作者很懒,什么都没留下…
展开
-
C - The Suspects
点击打开链接Severe acute respiratory syndrome (SARS), an atypical pneumonia of unknown aetiology, was recognized as a global threat in mid-March 2003. To minimize transmission to others, the best原创 2017-08-07 22:05:21 · 146 阅读 · 0 评论 -
C - Bellovin
点击打开链接Peter has a sequence $a_1,a_2,...,a_n$ and he define a function on the sequence -- $F(a_1,a_2,...,a_n)=(f_1,f_2,...,f_n)$, where $f_i$ is the length of the longest increasing subsequen原创 2017-08-12 15:22:19 · 227 阅读 · 1 评论 -
B - Rikka with Graph
点击打开链接As we know, Rikka is poor at math. Yuta is worrying about this situation, so he gives Rikka some math tasks to practice. There is one of them: Yuta has a non-direct graph with n vertic原创 2017-08-04 19:07:16 · 167 阅读 · 0 评论 -
A - 畅通工程
点击打开链接某省调查城镇交通状况,得到现有城镇道路统计表,表中列出了每条道路直接连通的城镇。省政府“畅通工程”的目标是使全省任何两个城镇间都可以实现交通(但不一定有直接的道路相连,只要互相间接通过道路可达即可)。问最少还需要建设多少条道路? Input测试输入包含若干测试用例。每个测试用例的第1行给出两个正整数,分别是城镇数目N ( 注意:两个城市之间可以有多条原创 2017-08-04 19:05:28 · 150 阅读 · 0 评论 -
J - Work
点击打开链接It’s an interesting experience to move from ICPC to work, end my college life and start a brand new journey in company. As is known to all, every stuff in a company has a tit原创 2017-08-07 22:17:15 · 164 阅读 · 0 评论 -
I - Pet
点击打开链接One day, Lin Ji wake up in the morning and found that his pethamster escaped. He searched in the room but didn’t find the hamster. He tried to use some cheese to trap the hamster. He p原创 2017-08-07 22:15:46 · 198 阅读 · 0 评论 -
H - Is It A Tree?
点击打开链接A tree is a well-known data structure that is either empty (null, void, nothing) or is a set of one or more nodes connected by directed edges between nodes satisfying the following pro原创 2017-08-07 22:14:17 · 199 阅读 · 0 评论 -
G - Ice_cream's world I
点击打开链接ice_cream's world is a rich country, it has many fertile lands. Today, the queen of ice_cream wants award land to diligent ACMers. So there are some watchtowers are set up, and wall be原创 2017-08-07 22:12:45 · 184 阅读 · 0 评论 -
F - 小希的迷宫
点击打开链接上次Gardon的迷宫城堡小希玩了很久(见Problem B),现在她也想设计一个迷宫让Gardon来走。但是她设计迷宫的思路不一样,首先她认为所有的通道都应该是双向连通的,就是说如果有一个通道连通了房间A和B,那么既可以通过它从房间A走到房间B,也可以通过它从房间B走到房间A,为了提高难度,小希希望任意两个房间有且仅有一条路径可以相通(除非走了回头路)。小希现在把她的设计原创 2017-08-07 22:11:14 · 194 阅读 · 1 评论 -
E - More is better
点击打开链接Mr Wang wants some boys to help him with a project. Because the project is rather complex, the more boys come, the better it will be. Of course there are certain requirements. Mr W原创 2017-08-07 22:09:40 · 134 阅读 · 0 评论 -
D - How Many Tables
点击打开链接Today is Ignatius' birthday. He invites a lot of friends. Now it's dinner time. Ignatius wants to know how many tables he needs at least. You have to notice that not all the friends kn原创 2017-08-07 22:07:58 · 250 阅读 · 0 评论 -
E - find the most comfortable road
点击打开链接XX星有许多城市,城市之间通过一种奇怪的高速公路SARS(Super Air Roam Structure---超级空中漫游结构)进行交流,每条SARS都对行驶在上面的Flycar限制了固定的Speed,同时XX星人对 Flycar的“舒适度”有特殊要求,即乘坐过程中最高速度与最低速度的差越小乘坐越舒服 ,(理解为SARS的限速要求,flycar必须瞬间提速/降速,原创 2017-08-12 15:43:50 · 195 阅读 · 0 评论