http://acm.hdu.edu.cn/showproblem.php?pid=3832
大致题意:给出n个灯的位置以及每个灯照亮的范围。问最后至多可以熄灭多少盏灯使得编号为1,2,3的点连通。
思路:若任意两灯的照亮范围相交,那么两点之间建边,权值为1。最后枚举一点使它到1,2,3点的距离最近,那么该距离之和+1(还有该点本身)代表必须不能熄灭的灯,那么熄灭的灯数就求出来...
分类:
其他好文 时间:
2014-05-22 08:46:23
阅读次数:
229
http://acm.hdu.edu.cn/showproblem.php?pid=3832
1 #include 2 #include 3 #include 4 #include 5 #include 6 #include 7 #include 8
#define maxn 1001...
分类:
其他好文 时间:
2014-05-18 20:36:07
阅读次数:
411
通过两个点的经纬度计算距离从google
maps的脚本里扒了段代码,没准啥时会用上。大家一块看看是怎么算的。private const double EARTH_RADIUS =
6378.137;private static double rad(double d){return d * Mat...
分类:
编程语言 时间:
2014-05-16 00:33:24
阅读次数:
365
1、ajax技术的背景不可否认,ajax技术的流行得益于google的大力推广,正是由于google
earth、google
suggest以及gmail等对ajax技术的广泛应用,催生了ajax的流行。而这也让微软感到无比的尴尬,因为早在97年,微软便已经发明了
ajax中的关键技术,并且在99...
分类:
其他好文 时间:
2014-05-14 08:57:23
阅读次数:
382
Problem Description
Acmers have been the Earth Protector against the evil enemy for a long time, now it’s your turn to protect our home.
There are 2 * n enemies in the map. Your task is to clear a...
分类:
其他好文 时间:
2014-05-13 11:29:40
阅读次数:
308
1、len(mapping) 返回映射的长度(键-值对的个数)
2、hash(obj) 返回obj的哈希值
>>> myDict = {'name':'earth', 'port':'80'}
>>> len(myDict)
2
>>> hash('name')
15034981
3、dict.copy...
分类:
编程语言 时间:
2014-05-11 14:40:22
阅读次数:
327
在理解EMD距离模型时,需要先对《运筹学》中运输问题,做一下...
分类:
其他好文 时间:
2014-05-09 22:21:40
阅读次数:
606
Problem 1977 Pandora adventure
Accept: 354 Submit: 1177
Time Limit: 1000 mSec Memory Limit : 32768 KB
Problem Description
The pollution of the earth is so serious that people can no...
分类:
其他好文 时间:
2014-04-29 13:13:22
阅读次数:
369