摘要: Dropping tests POJ - 2976 题意:给数组a和b, 选择其中的k个使得sigma(a[i])/sigma(b[i])最大。 F(L):=sigma(a[i]*x[i])-L*sigma(b[i]*x[i]), 题解链接:here 阅读全文
posted @ 2017-04-20 18:25 yijiull 阅读(126) 评论(0) 推荐(0) 编辑
摘要: 题目连接:http://poj.org/problem?id=2502 用模拟栈试试。。。 阅读全文
posted @ 2017-04-20 18:05 yijiull 阅读(89) 评论(0) 推荐(0) 编辑
摘要: 题目连接:http://poj.org/bbs?problem_id=1511 求1到各点再回到1的最短路之和。 数据太大,只能用spfa?? 阅读全文
posted @ 2017-04-20 08:45 yijiull 阅读(101) 评论(0) 推荐(0) 编辑
摘要: 题目连接:https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=2031 自己没想出,其实也不难。 首先判断图中是否存在环,若不存在则No cycle found 阅读全文
posted @ 2017-04-20 00:36 yijiull 阅读(98) 评论(0) 推荐(0) 编辑
摘要: 题目连接:http://acm.hdu.edu.cn/showproblem.php?pid=4370 很久之前做的题了,今天做一道spfa的题忽然想起这道。。。 题目给出的是矩阵,对应图的 出度、入度 等。。 想到了求1到n的最短路,没想到求最小环的情况。。 有人说不好想,其实是理解不到位。。 想 阅读全文
posted @ 2017-04-20 00:24 yijiull 阅读(182) 评论(0) 推荐(0) 编辑