随笔分类 -  玄学-贪心

摘要:题面:https://www.luogu.org/problem/P1315 cpp 本题的算法是贪心,可以每次讨论在哪一段使用氮气加速器惠及的人最多,然后做k次即可. 这里需要注意的是:统计人数时arrive[i] =last[i]+1才可以使用 而找到在第k个站台使用后,k后面的站台的arriv 阅读全文
posted @ 2019-09-27 13:29 prestige 阅读(164) 评论(0) 推荐(0)
摘要:题面:https://www.luogu.org/problem/P1016 cpp 本题直接贪心之后dfs即可,注意dfs要讨论两种情况. Code: include include include include include include include using namespace s 阅读全文
posted @ 2019-09-08 12:54 prestige 阅读(168) 评论(0) 推荐(0)