摘要: 题目传送门 思路: 这是一道贪心算法的策略问题。 贪心策略为: 设最大时间为 maxt,时间总和为 sumt,结果为 anst,则: 如果 maxt≥sumt-maxt,则 anst=2×maxt。 如果 maxt≤sumt-maxt,则 anst=sumt。 code: #include <ios 阅读全文
posted @ 2022-01-21 19:51 PandaBlack 阅读(88) 评论(0) 推荐(0)