CF893C Rumor 有n个人,其中有m对朋友,现在你有一个秘密你想告诉所有人,第i个人愿意出价a[i]买你的秘密,获得秘密的人会免费告诉它的所有朋友(他朋友的朋友也会免费知道),现在他们想出最少的价钱买秘密,那么你最少能得到多少钱? 刷水利于身心健康. code: #include <iostream> #include <cstdio> #include <cstring> #define int long long using namespace std; c…
传送门 Popular Cows Time Limit: 2000MS Memory Limit: 65536K Total Submissions: 31808 Accepted: 12921 Description Every cow's dream is to become the most popular cow in the herd. In a herd of N (1 <= N <= 10,000) cows, you are given up to M (1 <=…
Father Christmas flymouse Time Limit: 1000MS Memory Limit: 131072K Total Submissions: 3241 Accepted: 1099 Description After retirement as contestant from WHU ACM Team, flymouse volunteered to do the odds and ends such as cleaning out the computer…
Network of Schools Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 16571 Accepted: 6558 Description A number of schools are connected to a computer network. Agreements have been developed among those schools: each school maintains a li…
Network of Schools Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 16806 Accepted: 6643 Description A number of schools are connected to a computer network. Agreements have been developed among those schools: each school maintains a li…
Instantaneous Transference Time Limit: 5000MS Memory Limit: 65536K Description It was long ago when we played the game Red Alert. There is a magic function for the game objects which is called instantaneous transfer. When an object uses this magic fu…
King's Quest Time Limit: 15000MS Memory Limit: 65536K Case Time Limit: 2000MS Description Once upon a time there lived a king and he had N sons. And there were N beautiful girls in the kingdom and the king knew about each of his sons which of those g…
The Bottom of a Graph Time Limit: 3000MS Memory Limit: 65536K Total Submissions: 10114 Accepted: 4184 Description We will use the following (standard) definitions from graph theory. Let V be a nonempty and finite set, its elements being called ve…
Popular Cows Time Limit: 2000MS Memory Limit: 65536K Total Submissions: 29773 Accepted: 12080 Description Every cow's dream is to become the most popular cow in the herd. In a herd of N (1 <= N <= 10,000) cows, you are given up to M (1 <= M &…
Going from u to v or from v to u? Time Limit: 2000MS Memory Limit: 65536K Total Submissions: 16486 Accepted: 4386 Description In order to make their sons brave, Jiajia and Wind take them to a big cave. The cave has n rooms, and one-way corridors…
Network Time Limit: 5000MS Memory Limit: 65536K Total Submissions: 8669 Accepted: 3175 Description A network administrator manages a large network. The network consists of N computers and M links between pairs of computers. Any pair of computers…
题目链接 题意是说在几个邮局之间传送一份信件,如果出发点和终止点在同一个国家传递,则时间为0,否则让你求花费最少时间,如果不能传到,则输出Nao e possivel entregar a carta.判断邮局是否在同一个国家的依据是发出的信件可以相互到达. 如果直接求最短路则无法判断两个邮局是否在同一个国家,判断两个邮局是否属于同一个国家的标志是在这个国家邮局间可以相互到达,那么这就是强连通了,所以要先缩点判读邮局是否在同一个国家,如果不是,则重新建图,建图的时候要维护好边权,求出最短边权,在…
E. Cactus A connected undirected graph is called a vertex cactus, if each vertex of this graph belongs to at most one simple cycle. A simple cycle in a undirected graph is a sequence of distinct vertices v1, v2, ..., vt (t > 2), such that for any i…
Time Limit:2000MS Memory Limit:65536KB 64bit IO Format:%lld & %llu Submit Status Practice ZOJ 3795 Description Suppose there are N people in ZJU, whose ages are unknown. We have some messages about them. The i-th message shows that the age of…
题目 Source http://acm.hdu.edu.cn/showproblem.php?pid=4971 Description There's a company with several projects to be done. Finish a project will get you profits. However, there are some technical problems for some specific projects. To solve the proble…