随笔分类 - 最短路
摘要:The Shortest Path in Nya Graph Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Problem Description This is a very eas
阅读全文
摘要:"题目链接" 题意:有n个路口,m条通路,如果经过一条路则会得到(终点 起点)^3的权值,求从1点到其他点的最小权值,如果权值小于3或无法到达输出‘?’。 题解:因为权值可能为负,所以用SPFA来解题,如果这个点在负环中的话那么最后的权值一定小于3,注意最后输出的时候的判断。注意边的数量,这道题巨坑
阅读全文
摘要:Borg Maze Time Limit: 1000MS Memory Limit: 65536K Description The Borg is an immensely powerful race of enhanced humanoids from the delta quadrant of
阅读全文
摘要:Stockbroker Grapevine Time Limit: 1000MS Memory Limit: 10000K Description Stockbrokers are known to overreact to rumours. You have been contracted to
阅读全文
摘要:Cow Hurdles Time Limit: 1000MS Memory Limit: 65536K Description Farmer John wants the cows to prepare for the county jumping competition, so Bessie an
阅读全文
摘要:题意:给你点、边,求起点到终点的最短距离。 题解:由于题目的数据量特别大,所以需要用邻接表来存边,之后对Dijkstra算法稍微魔改一下就可以了,本来以为会超时,做好了打堆优化的准备,结果卡时间过了,可以说很开心了. 注意SPFA会超时。 include include include includ
阅读全文
摘要:Candies Time Limit: 1500MS Memory Limit: 131072K Description During the kindergarten days, flymouse was the monitor of his class. Occasionally the hea
阅读全文
摘要:Subway Time Limit: 1000MS Memory Limit: 65536K Description You have just moved from a quiet Waterloo neighbourhood to a big, noisy city. Instead of ge
阅读全文