
贪心
文章平均质量分 80
nka_kun
ACMer
展开
-
POJ 3253 Fence Repair(优先队列+思维贪心)(哈夫曼树算法)
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,000) planks of wood, each having some integer length Li (1 ≤ Li ...原创 2017-07-18 11:08:44 · 477 阅读 · 0 评论 -
CodeForces - 140C New Year Snowmen(贪心)
New Year SnowmenAs meticulous Gerald sets the table and caring Alexander sends the postcards, Sergey makes snowmen. Each showman should consist of three snowballs: a big one, a medium one and a small ...原创 2018-03-05 16:34:17 · 403 阅读 · 0 评论 -
2018省赛第九届蓝桥杯真题C语言B组第十题题解 乘积最大
2018第九届蓝桥杯C++省赛B组[最新题解汇总]标题:乘积最大给定N个整数A1, A2, ... AN。请你从中选出K个数,使其乘积最大。 请你求出最大的乘积,由于乘积可能超出整型范围,你只需输出乘积除以1000000009的余数。 注意,如果X<0, 我们定义X除以1000000009的余数是负(-X)除以1000000009的余数。即:0-((0-x) % 1000000009)【...原创 2018-04-02 14:42:27 · 3969 阅读 · 0 评论 -
Wannafly挑战赛15 最小化价格(贪心)
题目描述 现有n组人,m个地点,给出每组人的人数,每个地点可容纳的最大人数和选择的价格要求一种方式,使得每组人都到一个各不相同的地点,最小化选择的价格每个队伍的人都要在同一个地方每个地方只能有一个队伍输入描述:第一行n,m第二行n个数,表示每组的人数接下来m行,每行两个数,表示可容纳的最大人数和选择的价格输出描述:输出最小化选择的价格,无解输出-1示例1输入3 42 3 41 22 3...原创 2018-05-12 13:45:18 · 292 阅读 · 0 评论 -
HDU-6396 Swordsman
Swordsman Time Limit: 2000/1000 MS (Java/O...原创 2018-08-13 20:16:14 · 306 阅读 · 0 评论 -
HDU-5884 Sort(好题)
Sort Time Limit: 3000/1000 M...原创 2018-08-29 13:36:25 · 248 阅读 · 0 评论