2016年11月6日

Gym 101149I I - It's the Police

摘要: http://codeforces.com/gym/101149/problem/I 考虑下面这个例子 4 3 1 2 1 3 1 4 应该是选 0 0 1 1这样是最优的,我们不选1号,因为如果选1号作为非法分子点,那么2、3、4也不能有警察了,这不行。 那么究竟选呢? 很明显的一个道理是,选出儿 阅读全文

posted @ 2016-11-06 23:21 stupid_one 阅读(497) 评论(0) 推荐(0) 编辑

AtCoder D - 高橋君と見えざる手 / An Invisible Hand 简单思维题

摘要: http://arc063.contest.atcoder.jp/tasks/arc063_b 因为每次都是选取最大值,那么用dp[i]表示第i个数结尾能得到最大是多少。 其实就是用a[i]去减去左边最小的那个数字。 然后就是统计有多少个一样的最大值了。。 hack点 T是没用的,我被坑了,以为最多 阅读全文

posted @ 2016-11-06 22:56 stupid_one 阅读(312) 评论(0) 推荐(0) 编辑

HDU 5974 A Simple Math Problem 数学题

摘要: http://acm.hdu.edu.cn/showproblem.php?pid=5974 遇到数学题真的跪。。 题目要求 X + Y = a lcm(X, Y) = b 设c = gcd(x, y); 那么可以表达出x和y了,就是x = i * c; y = j * c; 其中i和j是互质的。 阅读全文

posted @ 2016-11-06 22:40 stupid_one 阅读(331) 评论(0) 推荐(0) 编辑

hdu 5971 Wrestling Match 判断能否构成二分图

摘要: http://acm.hdu.edu.cn/showproblem.php?pid=5971 Wrestling Match Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total S 阅读全文

posted @ 2016-11-06 19:09 stupid_one 阅读(1659) 评论(0) 推荐(0) 编辑

1047 - Best couple 好题~

摘要: http://www.ifrog.cc/acm/problem/1047 思路很简单,跑一发floyd,然后再用km。 但是问题来了,这个有可能n != m。那怎么办? 其实可以补上一些不存在的点。来使得n = m。他们的权值就设置为0就好了。意思就是这些人的搭配,是对答案没有贡献的。注意不能设置为 阅读全文

posted @ 2016-11-06 09:19 stupid_one 阅读(166) 评论(0) 推荐(0) 编辑

导航