题目链接:http://poj.org/problem?id=2387
dij 注意判重边
#include
#include
#include
#include
#include
using namespace std;
const int MAXV = 4010;
const int inf = 10000000;
int map[MAXV][MAXV];
int ...
分类:
其他好文 时间:
2015-01-28 14:46:58
阅读次数:
134
题意:午夜过后会有m个鬼魂来拜访,给出他们来拜访的时间点,现在有很多蜡烛,每个蜡烛能够燃烧 t 秒,Anya点燃一根蜡烛需要一秒的时间,比如Anya在p时刻点燃一根蜡烛,这根蜡烛会在p+1~p+t 时间段内燃烧,Anya能在任意时刻点蜡烛,现在要求当一个鬼魂来拜访的时候要有r 支蜡烛亮着,问Anya最少要点多少支蜡烛。
思路:用结构体表示蜡烛,里面记录这根蜡烛燃烧的时间段,然后扫描鬼魂拜访时间,在come[i] 时刻判断有哪些蜡烛在燃烧,没有燃烧的就要在come[i]时刻之前将它点燃,点燃它的时刻点离com...
分类:
其他好文 时间:
2015-01-28 14:39:15
阅读次数:
265
D - Doing Homework again
Time Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64u
Submit Status
Description
Ignatius has just come back school from the 30th ACM/ICPC....
分类:
其他好文 时间:
2015-01-24 14:34:22
阅读次数:
151
第一章 不存在--I believe that weare who we choose to be. Nobody‘s going to come and save you, you‘ve got tosave yourself. 我相信我们成为怎样的人是我们自己的选择。没有人会来拯救你,你必须要自己拯救自己。 中午在网上看图,看到这张照片,瞬间被吸引。人总是要有自己的兴趣和爱好,看图是我的一种方...
分类:
其他好文 时间:
2015-01-23 20:09:48
阅读次数:
156
JavaEE has some excellent built-in security mechanisms, but they don’t come close to covering all the threats that your applications will face. Many c...
分类:
编程语言 时间:
2015-01-23 10:58:41
阅读次数:
182
Is a loop ? Question descrip as follows :
Assume that wehave a head pointer to a link-list. Also assumethat we know the list is single-linked. Can you come up an algorithm to checkwhether this link list includes a loop by using O(n) time and O(1) ...
分类:
其他好文 时间:
2015-01-22 13:28:16
阅读次数:
229
Given a linked list and a value x, partition it such that all nodes less than x come before nodes greater than or equal to x.
You should preserve the original relative order of the nodes in each of...
分类:
其他好文 时间:
2015-01-21 18:12:02
阅读次数:
114
Doing Homework againTime Limit:1000MSMemory Limit:32768KB64bit IO Format:%I64d & %I64uDescriptionIgnatius has just come back school from the 30th ACM/...
分类:
其他好文 时间:
2015-01-19 18:53:25
阅读次数:
216
微软近期Open的职位:Are you looking for a big challenge? Do you know why Big Data is the next frontier for innovation, competition and productivity? Come join...
分类:
其他好文 时间:
2015-01-17 06:22:10
阅读次数:
264
Throughout the development of Parallel Extensions for the .NET Framework 4, we’ve come across a myriad of situations where certain functionality would...
分类:
其他好文 时间:
2015-01-13 19:33:44
阅读次数:
222