Battle Over Cities It is vitally important to have all the cities connected by highways in a war. If a city is occupied by the enemy, all the highways ...
分类:
其他好文 时间:
2018-01-05 10:28:40
阅读次数:
173
The island nation of Flatopia is perfectly flat. Unfortunately, Flatopia has no public highways. So the traffic is difficult in Flatopia. The Flatopia ...
分类:
其他好文 时间:
2017-11-30 20:13:30
阅读次数:
221
With highways available, driving a car from Hangzhou to any other city is easy. But since the tank capacity of a car is limited, we have to find gas s ...
分类:
其他好文 时间:
2017-10-25 11:35:48
阅读次数:
176
A traveler's map gives the distances between cities along the highways, together with the cost of each highway. Now you are supposed to write a progra ...
分类:
其他好文 时间:
2017-10-19 19:42:01
阅读次数:
167
题意: 给你N个城市的坐标,城市之间存在公路,但是由于其中一些道路损坏了,需要维修,维修的费用与公路长成正比(公路是直的)。 但现有M条公路是完整的,不需要维修,下面有M行,表示不需要维修的道路两端的城市,问最短费用。 思路: lowcost[i]数组存还未处理的城市i离已经处理过的城市的最短距离, ...
分类:
其他好文 时间:
2017-10-10 20:38:17
阅读次数:
167
1090. Highways Constraints Time Limit: 1 secs, Memory Limit: 32 MB Description The island nation of Flatopia is perfectly flat. Unfortunately, Flatopi ...
分类:
其他好文 时间:
2017-09-17 17:39:06
阅读次数:
161
https://vjudge.net/problem/UVA-1393 题意: a*b的点阵中能画多少条非水平非竖直的直线 方向‘/’ 和 方向 ‘\’ 对称 枚举直线所在矩形的i*j 直线可能重复的情况: 1、与矩形内部矩形的直线重复 2、与它左上角的直线连接成一条 如果gcd(i,j)>1, 那 ...
分类:
其他好文 时间:
2017-08-20 18:41:49
阅读次数:
196
Time Limit: 5000MS Memory Limit: 65536K Total Submissions: 1728 Accepted: 643 Case Time Limit: 2000MS Description “Highways are built, then life is ri ...
分类:
其他好文 时间:
2017-08-18 22:21:07
阅读次数:
184
https://vjudge.net/problem/SPOJ-HIGH 题意: 给n个点m条边,求生成树个数。 思路: 矩阵树裸题。 具体的话可以看一下周冬的论文《生成树的计数及其应用》。 简单说一下,$A[ ][ ]$为邻接矩阵,有边为1(其实也就是边的个数,有重边时要注意),无边为0。$D[ ...
分类:
其他好文 时间:
2017-08-14 10:12:44
阅读次数:
154
题目: The island nation of Flatopia is perfectly flat. Unfortunately, Flatopia has no public highways. So the traffic is difficult in Flatopia. The Flat ...
分类:
其他好文 时间:
2017-08-10 22:18:28
阅读次数:
228