随笔分类 -  算法_贪心策略

摘要:一、区间完全覆盖问题 问题描述:给定一个长度为m的区间,再给出n条线段的起点和终点(注意这里是闭区间),求最少使用多少条线段可以将整个区间完全覆盖。 样例:一个长度为8的区间,可选的线段有[2,6],[1,4],[3,6],[3,7],[6,8],[2,4],[3,5]。 求解过程: 1、将每一条线 阅读全文
posted @ 2018-10-21 13:23 霜雪千年 阅读(8834) 评论(2) 推荐(11) 编辑
摘要:Description Professor Ibrahim has prepared the final homework for his algorithm’s class. He asked his students to implement the Posterization Image Fi 阅读全文
posted @ 2018-07-16 10:38 霜雪千年 阅读(295) 评论(0) 推荐(0) 编辑
摘要:Appleman and Card Game Appleman and Card Game Time Limit: 2000/1000ms (Java/Others) Time Limit: 2000/1000ms (Java/Others) Problem Description: Applema 阅读全文
posted @ 2018-07-11 22:23 霜雪千年 阅读(202) 评论(0) 推荐(0) 编辑
摘要:Ruin of Titanic Ruin of Titanic Time Limit: 2000/1000ms (Java/Others) Time Limit: 2000/1000ms (Java/Others) Problem Description: 看完Titanic后,小G做了一个梦。梦见 阅读全文
posted @ 2018-07-04 18:39 霜雪千年 阅读(139) 评论(0) 推荐(0) 编辑
摘要:Problem description In the evening, after the contest Ilya was bored, and he really felt like maximizing. He remembered that he had a set of n sticks 阅读全文
posted @ 2018-06-08 20:01 霜雪千年 阅读(380) 评论(0) 推荐(0) 编辑
摘要:Problem description An elephant decided to visit his friend. It turned out that the elephant's house is located at point 0 and his friend's house is l 阅读全文
posted @ 2018-06-07 12:36 霜雪千年 阅读(342) 评论(0) 推荐(0) 编辑
摘要:Problem description Valera loves his garden, where n fruit trees grow. This year he will enjoy a great harvest! On the i-th tree bi fruit grow, they w 阅读全文
posted @ 2018-06-03 11:17 霜雪千年 阅读(292) 评论(0) 推荐(0) 编辑
摘要:Problem description Imagine that you have a twin brother or sister. Having another person that looks exactly like you seems very unusual. It's hard to 阅读全文
posted @ 2018-06-02 13:21 霜雪千年 阅读(339) 评论(0) 推荐(0) 编辑
摘要:Problem description Alice and Bob like games. And now they are ready to start a new game. They have placed n chocolate bars in a line. Alice starts to 阅读全文
posted @ 2018-06-02 11:00 霜雪千年 阅读(702) 评论(0) 推荐(0) 编辑
摘要:Problem description After the lessons n groups of schoolchildren went outside and decided to visit Polycarpus to celebrate his birthday. We know that 阅读全文
posted @ 2018-05-31 19:02 霜雪千年 阅读(416) 评论(0) 推荐(0) 编辑
摘要:发工资咯: 发工资咯: Time Limit: 2000/1000ms (Java/Others) Time Limit: 2000/1000ms (Java/Others) Problem Description: 作为广财大的老师,最盼望的日子就是每月的8号了,因为这一天是发工资的日子,养家糊口 阅读全文
posted @ 2018-05-10 13:07 霜雪千年 阅读(818) 评论(0) 推荐(0) 编辑
摘要:Meetings 系列一 Problem Description: 多年之后的广财ACM编协如日中天,下系多个部门,且编协成员几近过百。这一次,为了庆祝ACM编协近年飞速的发展,各部门都决定在同一天召开会议。请注意:这次由于资源紧张,仅申请到一个报告厅。现在需要你给出安排方案,使得同一天24小时内举 阅读全文
posted @ 2018-05-09 11:34 霜雪千年 阅读(1369) 评论(0) 推荐(0) 编辑
摘要:题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1789 Problem Description Ignatius has just come back school from the 30th ACM/ICPC. Now he has a lot of 阅读全文
posted @ 2018-03-08 07:59 霜雪千年 阅读(210) 评论(0) 推荐(0) 编辑
摘要:Problem Description 某国为了防御敌国的导弹袭击,发展出一种导弹拦截系统.但是这种导弹拦截系统有一个缺陷:虽然它的第一发炮弹能够到达任意的高度,但是以后每一发炮弹都不能超过前一发的高度.某天,雷达捕捉到敌国的导弹来袭.由于该系统还在试用阶段,所以只有一套系统,因此有可能不能拦截所有 阅读全文
posted @ 2018-03-04 21:34 霜雪千年 阅读(206) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示