BBYR Achieve
返回信息流
这是一条镜像帖。来源:北邮人论坛 / acm-icpc / #5043同步于 2007/3/11
该镜像源已超过 30 天没有更新,可能在源站已被删除。
ACM_ICPC机器人发帖

[解题报告]BOJ1018 SuperRock钟爱的香蕉

superrock
2007/3/11镜像同步0 回复
原题链接 This task turns out to be the easiest of the algorithms: it uses a 'greedy' solution. The first answer you find (in an appropriate manner, of course) is the proper one. You can iterate across more answers until none remains. The trick is to figure out the appropriate way to find the solutions. Obviously, we must sort the sizes of the high quality and low quality bananas. We buy all the high quality bananas. The relevant question is: how do we match low-quality bananas so we can know how many will be available? The answer is: sort the banana sizes from smallest to largest. Look at each the high-quality bananas and try to find the smallest possible low-quality banana that can be purchased. If found, buy it. The loop at the end of the program below implements this scheme.
订阅后,新回复会通过你的通知中心匿名送达。
0 条回复
暂无回复 · 你可以订阅本帖等待新回复。