点击打开链接 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 between watchtowers be build, in order to partition the ice_c…
Problem Description 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 between watchtowers be build, in order to partit…
对于某个靴子,如果0代表某个格能走,1代表不能走,那么只要连续的1的个数的最大值>=靴子的步长,那这个靴子就不能用. 那么只要对靴子和格子都按深度排个序,然后从大到小来扫一遍(靴子越来越浅,能走的格子就越来越少,也就是相当于在增加1的个数),现在只要能维护把0变成1后,连续的1个数的最大值就行了 用并查集就可以了(好像双向链表或者线段树也行?). #include<bits/stdc++.h> #define ll long long #define pa pair<int,int…
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=5458 Problem Description Given an undirected connected graph G with n nodes and m edges, with possibly repeated edges and/or loops. The stability of connectedness between node u and node v is defined by…
传送门 Wireless Network Time Limit: 10000MS Memory Limit: 65536K Total Submissions: 24513 Accepted: 10227 Description An earthquake takes place in Southeast Asia. The ACM (Asia Cooperated Medical team) have set up a wireless network with the lap co…
Wireless Network Time Limit: 10000MS Memory Limit: 65536K Total Submissions: 16065 Accepted: 6778 Description An earthquake takes place in Southeast Asia. The ACM (Asia Cooperated Medical team) have set up a wireless network with the lap computer…
Ubiquitous Religions Time Limit: 5000MS Memory Limit: 65536K Total Submissions: 23997 Accepted: 11807 Description There are so many different religions in the world today that it is difficult to keep track of them all. You are interested in findi…
The Accomodation of Students Time Limit: 5000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 4091 Accepted Submission(s): 1876 Problem Description There are a group of students. Some of them may know each ot…
G - A Bug's Life Time Limit:10000MS Memory Limit:65536KB 64bit IO Format:%I64d & %I64u Submit Status Practice POJ 2492 Appoint description: Description BackgroundProfessor Hopper is researching the sexual behavior of a rare species of bugs. H…
Benny has a spacious farm land to irrigate. The farm land is a rectangle, and is divided into a lot of samll squares. Water pipes are placed in these squares. Different square has a different type of pipe. There are 11 types of pipes, which is marked…
题目链接:http://codeforces.com/problemset/problem/731/C 题意:有n只袜子,每只都有一个颜色,现在他的妈妈要去出差m天,然后让他每天穿第 L 和第 R 只袜子,他为了让每天穿的袜子都是一个颜色的,他需要把袜子涂色,共有k种颜色,求最少需要涂多少只袜子,才能保证他每天穿的袜子都是一样的. 用并查集把所有联系在一起的袜子放到一个集合中去,然后这些袜子会变成一块一块的,我们在每一块中找一种颜色最多的,然后把当前块中的其他袜子都涂成这种颜色即可,累加即可 #…