随笔分类 -  贪心

摘要:Time Limit: 5 Sec Memory Limit: 162 MBSubmit: 1002 Solved: 535[Submit][Status][Discuss] Description 对于一个给定的序列a1, …, an,我们对它进行一个操作reduce(i),该操作将数列中的元素a 阅读全文
posted @ 2017-12-18 15:03 J_william 阅读(221) 评论(0) 推荐(0)
摘要:题目描述 N (1 <= N <= 50,000) cows conveniently numbered 1..N are driving in separate cars along a highway in Cowtopia. Cow i can drive in any of M differ 阅读全文
posted @ 2017-11-07 21:12 J_william 阅读(337) 评论(0) 推荐(0)
摘要:题目描述 Ever the maturing businessman, Farmer John realizes that he must manage his time effectively. He has N jobs conveniently numbered 1..N (1 <= N <= 阅读全文
posted @ 2017-10-24 21:00 J_william 阅读(287) 评论(0) 推荐(0)
摘要:题目描述 Farmer John has N cows that need to be milked (1 <= N <= 10,000), each of which takes only one unit of time to milk. Being impatient animals, som 阅读全文
posted @ 2017-10-23 21:52 J_william 阅读(249) 评论(0) 推荐(0)
摘要:题目描述 Bessie the cow, always a fan of shiny objects, has taken up a hobby of mining diamonds in her spare time! She has collected N diamonds (N≤50,000) 阅读全文
posted @ 2017-06-05 16:26 J_william 阅读(701) 评论(0) 推荐(0)
摘要:★★★ 输入文件:flow.in 输出文件:flow.out 简单对比 时间限制:1 s 内存限制:128 MB 在一个遥远的国度,一侧是风景秀美的湖泊,另一侧则是漫无边际的沙漠。该国的行政区划十分特殊,刚好构成一个N行M列的矩形,如上图所示,其中每个格子都代表一座城市,每座城市都有一个海拔高度。 阅读全文
posted @ 2017-05-19 21:49 J_william 阅读(312) 评论(0) 推荐(0)
摘要:时间限制: 1 s 空间限制: 128000 KB 题目等级 : 黄金 Gold 题目描述 Description 给定x轴上的N(0<N<100)条线段,每个线段由它的二个端点a_I和b_I确定,I=1,2,……N.这些坐标都是区间(-999,999)的整数。有些线段之间会相互交叠或覆盖。请你编写 阅读全文
posted @ 2017-04-09 20:52 J_william 阅读(249) 评论(0) 推荐(0)
摘要:题目描述 Description 恰逢 H 国国庆,国王邀请 n 位大臣来玩一个有奖游戏。首先,他让每个大臣在左、右手上面分别写下一个整数,国王自己也在左、右手上各写一个整数。然后,让这 n位大臣排成一排,国王站在队伍的最前面。排好队后,所有的大臣都会获得国王奖赏的若干金币,每位大臣获得的金币数分别 阅读全文
posted @ 2016-11-07 10:04 J_william 阅读(242) 评论(0) 推荐(0)