Dark roads Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 1067 Accepted Submission(s): 474 Problem Description Economic times these days are tough, even in Byteland. To reduce the operating…
/* Kruskal模板 */ struct edge{ int from; int to; int next; int value; bool operator<(const edge a) const{ return value<a.value ; } }; const int inf=0x3f3f3f3f; inline int find(int k){ if(k==f[k]) return k; else return f[k]=find(f[k]); } inline int mer…
Description The island nation of Flatopia is perfectly flat. Unfortunately, Flatopia has no public highways. So the traffic is difficult in Flatopia. The Flatopian government is aware of this problem. They're planning to build some highways so that i…
Description Windy has a country, and he wants to build an army to protect his country. He has picked up N girls and M boys and wants to collect them to be his soldiers. To collect a soldier without any privilege, he must pay 10000 RMB. There are some…
链接: http://poj.org/problem?id=3026 http://acm.hust.edu.cn/vjudge/contest/view.action?cid=22010#problem/J Borg Maze Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 6905 Accepted: 2315 Description The Borg is an immensely powerful race o…
Network Time Limit: 1000MS Memory Limit: 30000K Total Submissions: 14021 Accepted: 5484 Special Judge Description Andrew is working as system administrator and is planning to establish a new network in his company. There will be N hubs in the c…
Luogu最小生成树模板题 Prim 原理与dijkstra几乎相同,每次找最优的点,用这个点去松弛未连接的点,也就是用这个点去与未连接的点连接. #include<cstdio> #include<vector> using namespace std; struct data { int to,val; }; vector<data> edge[200001]; int n,m,cost[5001],ans; bool visit[5001]; void add(i…