单位时间的调度问题 —— 贪心
摘要:单位时间的调度问题 题目描述: 现有一个机器要处理n项任务,每项任务都可以在一个单位时间内完成。每项任务有截止时间(d1, d2,,…, dn),和超过截止时间内未完成的惩罚因子(w1, w2,,…, wn)。求所有任务排列中最小的惩罚因子和。例如若有3项任务,其截止时间为(2,2,2),惩罚因子为
阅读全文
posted @
2020-12-11 20:24
蔡军帅
阅读(718)
推荐(0) 编辑
PAT 甲级 1070 Mooncake (25 分)(结构体排序,贪心,简单)
摘要:1070 Mooncake (25 分) 1070 Mooncake (25 分) 1070 Mooncake (25 分) Mooncake is a Chinese bakery product traditionally eaten during the Mid-Autumn Festival
阅读全文
posted @
2019-10-31 13:07
蔡军帅
阅读(290)
推荐(0) 编辑
PAT 甲级 1067 Sort with Swap(0, i) (25 分)(贪心,思维题)*
摘要:1067 Sort with Swap(0, i) (25 分) 1067 Sort with Swap(0, i) (25 分) 1067 Sort with Swap(0, i) (25 分) Given any permutation of the numbers {0, 1, 2,...,
阅读全文
posted @
2019-10-26 22:16
蔡军帅
阅读(513)
推荐(0) 编辑
复制书稿(book) (二分,贪心+dp)
摘要:复制书稿(book) 题目描述 现在要把m本有顺序的书分给k个人复制(抄写),每一个人的抄写速度都一样,一本书不允许给两个(或以上)的人抄写,分给每一个人的书,必须是连续的,比如不能把第一、第三和第四本书给同一个人抄写。 现在请你设计一种方案,使得复制时间最短。复制时间为抄写页数最多的人用去的时间。
阅读全文
posted @
2018-05-18 15:06
蔡军帅
阅读(1501)
推荐(0) 编辑
普及组2008NOIP 排座椅(贪心+排序)
摘要:排座椅 题目描述 上课的时候总有一些同学和前后左右的人交头接耳,这是令小学班主任十分头疼的一件事情。不过,班主任小雪发现了一些有趣的现象,当同学们的座次确定下来之后,只有有限的D对同学上课时会交头接耳。同学们在教室中坐成了M行N列,坐在第i行第j列的同学的位置是(i, j),为了方便同学们进出,在教
阅读全文
posted @
2018-05-10 15:40
蔡军帅
阅读(1210)
推荐(0) 编辑
POJ 2706 Painter
摘要:Painter Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 3157 Accepted: 1962 Description The local toy store sells small fingerpainting kits
阅读全文
posted @
2018-02-06 22:32
蔡军帅
阅读(113)
推荐(0) 编辑
POJ 1328 Radar Installation
摘要:Radar Installation Time Limit:1000MS Memory Limit:10000KB 64bit IO Format:%I64d & %I64u Submit Status Practice POJ 1328 Radar Installation Submit Stat
阅读全文
posted @
2018-02-06 20:47
蔡军帅
阅读(130)
推荐(0) 编辑
POJ 1700 Crossing River
摘要:Crossing River Problem Description A group of N people wishes to go across a river with only one boat, which can at most carry two persons. Therefore
阅读全文
posted @
2018-02-06 19:25
蔡军帅
阅读(127)
推荐(0) 编辑
poj 3253 Fence Repair (贪心,优先队列)
摘要:Description Farmer John wants to repair a small length of the fence around the pasture. He measures the fence and finds that he needs N (1 ≤ N ≤ 20,00
阅读全文
posted @
2018-02-06 18:33
蔡军帅
阅读(185)
推荐(0) 编辑
poj 3069 Saruman's Army(贪心)
摘要:Saruman's Army Problem Description Saruman the White must lead his army along a straight path from Isengard to Helm’s Deep. To keep track of his force
阅读全文
posted @
2018-02-06 18:05
蔡军帅
阅读(195)
推荐(0) 编辑
poj3190 Stall Reservations (贪心+优先队列)
摘要:Cleaning Shifts Problem Description Farmer John is assigning some of his N (1 <= N <= 25,000) cows to do some cleaning chores around the barn. He alwa
阅读全文
posted @
2018-02-02 14:36
蔡军帅
阅读(196)
推荐(0) 编辑
POJ 2376 Cleaning Shifts
摘要:Cleaning Shifts Problem Description Farmer John is assigning some of his N (1 <= N <= 25,000) cows to do some cleaning chores around the barn. He alwa
阅读全文
posted @
2018-02-02 13:55
蔡军帅
阅读(128)
推荐(0) 编辑