关闭

福建第六届省赛 H 贪心 哈夫曼思想

ZB loves playing StarCraft and he likes Zerg most! One day, when ZB was playing SC2, he came up with an idea: He wants to change the queen's ability, the queen's new ability is to choose a worker at any time, and turn it into an egg, after K units of tim...
阅读(209) 评论(0)

福建第六届省赛 最长连续串(贪心)

ZB is playing a card game where the goal is to make straights. Each card in the deck has a number between 1 and M(including 1 and M). A straight is a sequence of cards with consecutive values. Values do not wrap around, so 1 does not come after M. In addit...
阅读(208) 评论(0)

树的最小支配集poj3659、最小点覆盖、最大独立集

Cell Phone Network Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 7002 Accepted: 2509 Description Farmer John has decided to give each of his cows a cell phone in hopes to encourage their social interaction. This, however, requires him to se...
阅读(304) 评论(0)

51nod 1091 线段的重叠 (贪心)

1091 线段的重叠 基准时间限制:1 秒 空间限制:131072 KB 分值: 5 难度:1级算法题 X轴上有N条线段,每条线段包括1个起点和终点。线段的重叠是这样来算的,[10 20]和[12 25]的重叠部分为[12 20]。 给出N条线段的起点和终点,从中选出2条线段,这两条线段的重叠部分是最长的。输出这个最长的距离。如果没有重叠,输出0。 Input 第1行:线段的数量N(2 <= N <= 50000)。 第2 - N + 1行:每行2个数,线段的起点和终点。(0 <= s , e <= 10^...
阅读(427) 评论(0)

贪心算法基础之任务执行顺序 51nod 贪心教程

有N个任务需要执行,第i个任务计算时占R[i]个空间,而后会释放一部分, 最后储存计算结果需要占据O[i]个空间(O[i] 例如:执行需要5个空间,最后储存需要2个空间。 给出N个任务执行和存储所需的空间,问执行所有任务最少需要多少空间。 输入 第1行:1个数N,表示任务的数量。(2 <= N <= 100000) 第2 - ...
阅读(112) 评论(0)
9条 共2页1 2 下一页 尾页
    个人资料
    • 访问:63464次
    • 积分:2219
    • 等级:
    • 排名:第18771名
    • 原创:159篇
    • 转载:9篇
    • 译文:0篇
    • 评论:29条
    博客专栏
    最新评论