算法
文章平均质量分 88
Improving!
这个作者很懒,什么都没留下…
展开
-
Codeforces B. Peculiar Movie Preferences
题目B. Peculiar Movie Preferencestime limit per test2 secondsmemory limit per test512 megabytesinputstandard inputoutputstandard outputMihai plans to watch a movie. He only likes palindromic movies, so he wants to skip some (possibly zero) scenes t原创 2022-05-09 13:33:23 · 234 阅读 · 0 评论 -
每日一题:codeforces题解(Peculiar Movie Preferences)
题目B. Peculiar Movie Preferencestime limit per test2 secondsmemory limit per test512 megabytesinputstandard inputoutputstandard outputMihai plans to watch a movie. He only likes palindromic movies, so he wants to skip some (possibly zero) scenes t原创 2022-02-11 10:41:00 · 436 阅读 · 0 评论 -
算法笔记——贪心算法
贪心算法就是通过局部最优达到全体最优的目的。下面用两道习题来说明贪心算法。贪心算法一般难以证明,所以在想到某个策略,又无法举出反例的情况下就可以采用贪心算法。例题1:暑假到了,小明终于可以开心的看电视了。但是小明喜欢的节目太多了,他希望尽量多的看到完整的节目。现在他把他喜欢的电视节目的转播时间表给你,你能帮他合理安排吗?输入输入包含多组测试数据。每组输入的第一行是一个整数n(n<=100),表示小明喜欢的节目的总数。接下来n行,每行输入两个整数si和ei(1<=i<=n),表示原创 2022-02-06 16:34:53 · 343 阅读 · 0 评论