摘要: 来自《训练指南》优先级队列的例题。 题目链接:http://acm.hust.edu.cn/vjudge/problem/viewProblem.action?id=18702 题意:给定k个整数数组,各包含k个元素。在每个数组中取一个元素加起来,可以得到kk个和,求这些和中最小的k个值(不去重)。 阅读全文
posted @ 2016-05-16 13:52 helena_wang 阅读(180) 评论(0) 推荐(0) 编辑
摘要: 题目链接:http://poj.org/problem?id=2010 题意:C只牛犊,各有自己的分数score和申请的补助aid,现要选出N只(N为奇数),使得其aid的总和不超过F,且按score排序后中位数最大。 数据范围:N [1, 19999], C [N, 10^5], aid [0, 阅读全文
posted @ 2016-05-13 14:56 helena_wang 阅读(194) 评论(0) 推荐(0) 编辑
摘要: 2015沈阳区域赛现场赛第2题 题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=5510 题意:给定一个由字符串组成的序列,一共n个元素,每个元素是一个不超过2000个字符的字符串。求"存在秩小于 i 且不是 i 的子串"的最大的 i (1<= i <= 阅读全文
posted @ 2016-05-12 23:18 helena_wang 阅读(236) 评论(0) 推荐(0) 编辑
摘要: 本节介绍平面划分问题,即n条直线最多把一个平面划分为几个区域(region)。 问题描述: "What is the maximum number Ln of regions defined by n lines in the plane?" 这个问题最初由瑞士数学家Jacob Steiner在18 阅读全文
posted @ 2016-05-11 23:39 helena_wang 阅读(331) 评论(0) 推荐(0) 编辑
摘要: 题目链接:http://poj.org/problem?id=3614 题意:C头牛去晒太阳,每头牛有自己所限定的spf安全范围[min, max];有L瓶防晒液,每瓶有自己的spf值和容量(能供几头牛用)。 求这L瓶防晒液最多能让多少头牛安全地晒太阳。 思路:贪心策略,按spf从小到大或从大到小的 阅读全文
posted @ 2016-05-10 23:43 helena_wang 阅读(218) 评论(0) 推荐(0) 编辑
摘要: 这一节借助汉诺塔问题引入了"Reccurent Problems"。 (Reccurence, 在这里解释为“the solution to each problem depends on the solutions to smaller instances of the same problem” 阅读全文
posted @ 2016-05-09 21:48 helena_wang 阅读(221) 评论(0) 推荐(0) 编辑
摘要: 2015北京区域赛现场赛第2题。 题面:http://media.hihocoder.com/contests/icpcbeijing2015/problems.pdf OJ链接:http://hihocoder.com/problemset/problem/1255 题意:给4个矩形的宽和高,问能 阅读全文
posted @ 2016-05-08 11:06 helena_wang 阅读(299) 评论(0) 推荐(0) 编辑
摘要: 2015北京区域赛现场赛第4题。 题面:http://media.hihocoder.com/contests/icpcbeijing2015/problems.pdf OJ链接:http://hihocoder.com/problemset/problem/1257 题意:长度依次为1到N的N条蛇 阅读全文
posted @ 2016-05-07 21:13 helena_wang 阅读(504) 评论(0) 推荐(0) 编辑
摘要: 2015上海区域赛现场赛第5题。 题目连接:http://acm.hdu.edu.cn/showproblem.php?pid=5572 题意:在平面上,已知圆(O, R),点B、A(均在圆外),向量V。 一个小球从A出发,沿速度向量V匀速前进,若撞到圆则发生弹性碰撞,沿“反射方向”继续匀速前进。问 阅读全文
posted @ 2016-05-06 14:25 helena_wang 阅读(707) 评论(0) 推荐(1) 编辑
摘要: 2015北京区域赛现场赛签到题。 题面:http://media.hihocoder.com/contests/icpcbeijing2015/problems.pdf OJ链接:http://hihocoder.com/problemset/problem/1258?sid=788340 题意:T 阅读全文
posted @ 2016-05-06 13:08 helena_wang 阅读(160) 评论(0) 推荐(0) 编辑