2016年10月24日

HDU 1029 一道微软面试题

摘要: http://acm.hdu.edu.cn/showproblem.php?pid=1029 给定一个数组,其中有一个相同的数字是出现了大于等于(n + 1) / 2次的。要求找出来、 1、明显排序后,中间那个位置的就是ans,复杂度O(nlogn) 2、 考虑分治 假设那个人是ans,那么对于其他 阅读全文

posted @ 2016-10-24 23:52 stupid_one 阅读(193) 评论(0) 推荐(0) 编辑

HDU 1024 A - Max Sum Plus Plus DP + 滚动数组

摘要: http://acm.hdu.edu.cn/showproblem.php?pid=1024 刚开始的时候没看懂题目,以为一定要把那n个数字分成m对,然后求m对中和值最大的那对 但是不是,题目说的只是选出m对,所以有些数字是可以不用的。 那么就用 dp[i][j]表示前j个数,分成了i段,其中第a[ 阅读全文

posted @ 2016-10-24 20:23 stupid_one 阅读(174) 评论(0) 推荐(0) 编辑

2016-2017 ACM-ICPC, NEERC, Southern Subregional Contest A. Toda 2 贪心 + 暴力

摘要: A. Toda 2 time limit per test 2 seconds memory limit per test 512 megabytes input standard input output standard output A. Toda 2 time limit per test 阅读全文

posted @ 2016-10-24 09:32 stupid_one 阅读(559) 评论(0) 推荐(0) 编辑

导航