
ACM - 贪心
文章平均质量分 79
Freenm
这个作者很懒,什么都没留下…
展开
-
codeforces 355C - Vasya and Robot
因为在允许的情况下,必然是左右手交替进行,这样不会增加多余的无谓的能量。然后根据不同的分界点,肯定会产生左手或右手重复使用的情况,这是就要加上Qr/Ql * 次数。一开始的想法,很直接,枚举每个分界点,计算出总共要用的能量,取最小的那个即是答案:#include#includeusing namespace std;int main(){ int n,l,r,Q_l,Q原创 2017-03-26 10:28:53 · 347 阅读 · 0 评论 -
codeforces 761D - Dasha and Very Difficult Problem
time limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputDasha logged into the system and began to solve problems. One of原创 2017-03-19 21:02:55 · 476 阅读 · 0 评论 -
HDU 1789 - Doing Homework again
Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 13421 Accepted Submission(s): 7816Problem DescriptionIgnatius has just come b原创 2017-03-09 23:21:08 · 319 阅读 · 0 评论 -
POJ 1456 - Supermarket
和HDU 1789 - Doing Homework again一个套路#include#includeusing namespace std;struct type{ int profit; int deadline;}prod[10000+5];bool day[10000+5];bool cmp(type x,type y){ return x.profit>y.pr原创 2017-03-16 21:45:10 · 287 阅读 · 0 评论 -
Codeforces 665C - Simple Strings
zscoder loves simple strings! A string t is called simple if every pair of adjacent characters are distinct. For example ab, aba, zscoder are simple whereas aa, add are not simple.zscoder is given原创 2017-03-10 22:10:25 · 344 阅读 · 0 评论 -
POJ 1328 - Radar Installation
DescriptionAssume the coasting is an infinite straight line. Land is in one side of coasting, sea in the other. Each small island is a point locating in the sea side. And any radar installation, l原创 2017-03-09 16:25:17 · 291 阅读 · 0 评论 -
POJ 1700 - Crossing River
Time Limit: 1000MS Memory Limit: 10000KTotal Submissions: 13982 Accepted: 5349DescriptionA group of N people wishes to go across a river with only one boat, which can at原创 2017-03-08 22:26:34 · 299 阅读 · 0 评论 -
JNUOJ 1032 - 食物处理器
小明喜欢把土豆块放在食物处理器中处理。长度不超过H的土豆块放入处理器中,处理器每秒处理长度为k(即土豆块长度减少k)。如果土豆块长度小于k,土豆块会被完全处理掉。小明有n块土豆,第i块土豆的长度为ai 。小明把这些土豆块一块一块地从编号1到n地放入处理器中。每秒钟处理器中都发生着以下事情:如果有至少一块剩余的土豆,小明一个接一个地把土豆块放在处理器中,直到没有足够的空间放下一块。Input第一行n原创 2017-02-20 19:38:58 · 368 阅读 · 0 评论