会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
Black-Panda's Blog
Where there is a will, there is a way!
博客园
首页
新随笔
联系
订阅
管理
2022年1月21日
洛谷 P7176 题解
摘要: 题目传送门 思路: 这是一道贪心算法的策略问题。 贪心策略为: 设最大时间为 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)
公告