随笔分类 -  图论

摘要:2476: Star travelResultTIME LimitMEMORY LimitRun TimesAC TimesJUDGE3s65536K895177StandardIn the future world, one can travel by spaceship from one star to another. Because of the long distance, the fuel consumption is not linear with distance. We should take more material within our spaceship, so th 阅读全文
posted @ 2012-05-16 19:23 漂木 阅读(298) 评论(0) 推荐(0)
摘要:最近上图论,学了单源最短路径的Dijkstra算法。Dijkstra算法的核心思想是贪心策略+动态规划。老师只字不提思想,硬分析过程还是有点@#$%的。结果就是,原先我还挺懂的,听完就凌乱了。在这里写一下吧=================================================参考资料:Wikipedia:http://en.wikipedia.org/wiki/Dijkstra's_algorithmNocow:http://www.nocow.cn/index.php/Dijkstra%E7%AE%97%E6%B3%95CLRS《算法设计与分析》===== 阅读全文
posted @ 2012-05-15 12:23 漂木 阅读(2675) 评论(0) 推荐(0)
摘要:1184: The Circumference of the CircleResultTIME LimitMEMORY LimitRun TimesAC TimesJUDGE1s8192K558338StandardTo calculate the circumference of a circle seems to be an easy task - provided you know its diameter. But what if you don't?You are given the cartesian coordinates of three non-collinear p 阅读全文
posted @ 2012-04-18 23:20 漂木 阅读(255) 评论(0) 推荐(0)
摘要:2535: Train TicketResultTIME LimitMEMORY LimitRun TimesAC TimesJUDGE3s65536K394136Standard每次出外比赛,火车票的问题就出现了。太多的火车路线使acm的教练Coach Li很迷惘,当然,他总是努力使得总起来的火车票价最少。你能帮助他一下吗?输入给出n和m,表示有n个城市。之后的m次查询。之后会跟随(n*n)的数字矩阵,a[i][j] 表示i车站到j车站需要a[i][j]的钱。注意a[i][j]与a[j][i]无必然联系。然后是m对整数。如果一对整数i,j。表示求城市i到城市j的最小花费n<=100; 阅读全文
posted @ 2012-04-17 19:32 漂木 阅读(271) 评论(0) 推荐(0)