随笔分类 -  ACM-最短路问题

摘要:1491: [NOI2007]社交网络 Description 在社交网络(socialnetwork)的研究中,我们常常使用图论概念去解释一些社会现象。不妨看这样的一个问题。 在一个社交圈子里有n个人,人与人之间有不同程度的关系。我们将这个关系网络对应到一个n个结点的无向图上, 两个不同的人若互相 阅读全文
posted @ 2018-12-17 20:05 StarHai 阅读(292) 评论(0) 推荐(0)
摘要:Problem 1003. -- [ZJOI2006]物流运输 1003: [ZJOI2006]物流运输 Description 物流公司要把一批货物从码头A运到码头B。由于货物量比较大,需要n天才能运完。货物运输过程中一般要转 停好几个码头。物流公司通常会设计一条固定的运输路线,以便对整个运输过程 阅读全文
posted @ 2018-12-03 22:57 StarHai 阅读(253) 评论(0) 推荐(0)
摘要:3040: 最短路(road) Description N个点,M条边的有向图,求点1到点N的最短路(保证存在)。1<=N<=1000000,1<=M<=10000000 N个点,M条边的有向图,求点1到点N的最短路(保证存在)。1<=N<=1000000,1<=M<=10000000 Input 阅读全文
posted @ 2018-10-25 23:10 StarHai 阅读(431) 评论(0) 推荐(0)
摘要:N (1 ≤ N ≤ 100) cows, conveniently numbered 1..N, are participating in a programming contest. As we all know, some cows code better than others. Each 阅读全文
posted @ 2018-08-22 21:34 StarHai 阅读(336) 评论(0) 推荐(0)
摘要:链接:http://acm.hdu.edu.cn/showproblem.php?pid=6331 Walking Plan Problem Description There are n intersections in Bytetown, connected with m one way str 阅读全文
posted @ 2018-07-31 22:06 StarHai 阅读(310) 评论(0) 推荐(0)
摘要:1 A*算法 A*算法在人工智能中是一种典型的启发式搜索算法,启发中的估价是用估价函数表示的: 其中f(n)是节点n的估价函数,g(n)表示实际状态空间中从初始节点到n节点的实际代价,h(n)是从n到目标节点最佳路径的估计代价。另外定义h'(n)为n到目标节点最佳路径的实际值。如果h'(n)≥h(n 阅读全文
posted @ 2018-07-29 19:56 StarHai 阅读(2906) 评论(0) 推荐(0)
摘要:喜马拉雅山上的猴子Time Limit: 1000 MS Memory Limit: 256 MBSubmit Status余周周告诉我喜马拉雅山上有猴子,他们知道点石成金的方法。我不信,于是余周周带我去喜马拉雅山拜访猴子。喜马拉雅山上有n个猴子聚落,不妨叫... 阅读全文
posted @ 2018-07-29 19:56 StarHai 阅读(381) 评论(0) 推荐(0)
摘要:Weiwei is a software engineer of ShiningSoft. He has just excellently fulfilled a software project with his fellow workers. His boss i... 阅读全文
posted @ 2018-07-29 19:56 StarHai 阅读(398) 评论(0) 推荐(0)
摘要:Since 1945, when the first nuclear bomb was exploded by the Manhattan Project team in the US, the number of nuclear weapons have soar... 阅读全文
posted @ 2018-07-29 19:56 StarHai 阅读(227) 评论(0) 推荐(0)
摘要:Marica is very angry with Mirko because he found a new girlfriend and she seeks revenge.Since she doesn't live in the same city, she started preparing 阅读全文
posted @ 2018-07-29 19:56 StarHai 阅读(464) 评论(0) 推荐(0)
摘要:杭州有N个景区,景区之间有一些双向的路来连接,现在8600想找一条旅游路线,这个路线从A点出发并且最后回到A点,假设经过的路线为V1,V2,....VK,V1,那么必须满足K>2,就是说至除了出发点以外至少要经过2个其他不同的景区,而且不能重复经过同一个景区。现在86... 阅读全文
posted @ 2018-07-29 19:56 StarHai 阅读(203) 评论(0) 推荐(0)
摘要:Arbitrage is the use of discrepancies in currency exchange rates to transform one unit of a currency into more than one unit of the sa... 阅读全文
posted @ 2018-07-29 19:55 StarHai 阅读(278) 评论(0) 推荐(0)
摘要:oooccc1 is a Software Engineer who has to ride to the work place every Monday through Friday. For a long period, he went to office w... 阅读全文
posted @ 2018-07-29 19:55 StarHai 阅读(287) 评论(0) 推荐(0)
摘要:Henry decides to develop a web site, which will provide the service of transit search. But he can only get the transit data of Guangzh... 阅读全文
posted @ 2018-07-29 19:55 StarHai 阅读(300) 评论(0) 推荐(0)
摘要:A group of thieves is approaching a museum in the country of zjsxzy,now they are in city A,and the museum is in city B,where keeps man... 阅读全文
posted @ 2018-07-29 19:55 StarHai 阅读(218) 评论(0) 推荐(0)
摘要:You have been given a matrix C N*M, each element E of C N*M is positive and no more than 1000, The problem is that if there exist N nu... 阅读全文
posted @ 2018-07-29 19:55 StarHai 阅读(201) 评论(0) 推荐(0)
摘要:Ali has taken the Computer Organization and Architecture course this term. He learned that there may be dependence between instruction... 阅读全文
posted @ 2018-07-29 19:55 StarHai 阅读(361) 评论(0) 推荐(0)
摘要:Liyuan wanted to rewrite the famous book “Journey to the West” (“Xi You Ji” in Chinese pinyin). In the original book, the Monkey King ... 阅读全文
posted @ 2018-07-29 19:55 StarHai 阅读(264) 评论(0) 推荐(0)
摘要:A supermarket in Tehran is open 24 hours a day every day and needs a number of cashiers to fit its need. The supermarket manager has h... 阅读全文
posted @ 2018-07-29 19:54 StarHai 阅读(415) 评论(0) 推荐(0)
摘要:It is well known that, in the period of The Three Empires, Liu Bei, the emperor of the Shu Empire, was defeated by Lu Xun, a general of the Wu Empire. 阅读全文
posted @ 2018-07-29 19:54 StarHai 阅读(319) 评论(0) 推荐(0)