通过BFS可以求出到每个站点的最小花费. 每次从队首取出一个点,枚举所有它能花费1块钱就到达的线路,通过两遍递推求出最大时间. 注意到每个点和每条线路只有第一次使用时有用,所以总时间复杂度为$O(n+m)$. #include<cstdio> #include<cstring> #include<algorithm> typedef unsigned long long ll; const int N=300010,M=100010,E=1000010,inf=1000…
Search GO 说明:输入题号直接进入相应题目,如需搜索含数字的题目,请在关键词前加单引号 Problem ID Title Source AC Submit Y 1000 A+B Problem 10983 18765 Y 1036 [ZJOI2008]树的统计Count 5293 13132 Y 1588 [HNOI2002]营业额统计 5056 13607 1001 [BeiJing2006]狼抓兔子 4526 18386 Y 2002 [Hnoi2010]Bounce 弹飞绵羊 43…
Subway Time Limit: 7000/3500 MS (Java/Others) Memory Limit: 262144/262144 K (Java/Others)Total Submission(s): 860 Accepted Submission(s): 126Special Judge Problem Description jiefangxuanyan and yiyi cat are universally acknowledged model couple…
1272. Non-Yekaterinburg Subway Time limit: 1.0 secondMemory limit: 64 MB A little town started to construct a subway. The peculiarity of the town is that it is located on small islands, some of them are connected with tunnels or bridges. The mayor is…
Non-Yekaterinburg Subway Time limit: 1.0 secondMemory limit: 64 MB A little town started to construct a subway. The peculiarity of the town is that it is located on small islands, some of them are connected with tunnels or bridges. The mayor is sure…
Subway 题目链接: http://acm.hust.edu.cn/vjudge/contest/122685#problem/L Description You have just moved from a quiet Waterloo neighbourhood to a big, noisy city. Instead of getting to ride your bike to school every day, you now get to walk and take the s…
Subway Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 4928 Accepted: 1602 Description You have just moved from a quiet Waterloo neighbourhood to a big, noisy city. Instead of getting to ride your bike to school every day, you now get…