Codeforces Good Bye 2023】的更多相关文章

codeforces Good bye 2016 E 线段树维护dp区间合并 题目大意:给你一个字符串,范围为‘0’~'9',定义一个ugly的串,即串中的子串不能有2016,但是一定要有2017,问,最少删除多少个字符,使得串中符合ugly串? 思路:定义dp(i, j),其中i=5,j=5,因为只需要删除2016当中其中一个即可,所以一共所需要删除的字符和需要的字符为20176,因此i和j只要5就够了. 然后转移就是dp(i,i) = 0, 如果说区间大小为1的话,那么如果是2017中的一个…
Good Bye 2018! 题目链接:https://codeforces.com/contest/1091 A. New Year and the Christmas Ornament 题意: 给出三堆数量分别为y,b,r的东西,现在要你从三堆中各选一堆,满足y'+1=b'且b'+1=r' (y',r',b'分别是指从中选取的个数). 现在问最多能拿出的个数为多少. 题解: 我是直接模拟的= =但是有更简单的方法. 让y+=2,b+=1,那么现在的最优解为min(y,b,r)*3-3.这个还…
题目链接:http://codeforces.com/problemset/problem/611/B 题目意思:就是在 [a, b] 这个范围内(1 ≤ a ≤ b ≤ 10^18)统计出符合二进制数表示只有 1 个 0 的数量是多少. *********************** 首先贴出一段绝对会超时的代码,连提交的勇气都木有呢~因为第四组数据已经接近龟速了,所以...(大家可忽略) #include <iostream> #include <cstdio> #includ…
D. New Year and Ancient Prophecy 题目连接: http://www.codeforces.com/contest/611/problem/C Description Limak is a little polar bear. In the snow he found a scroll with the ancient prophecy. Limak doesn't know any ancient languages and thus is unable to u…
C. New Year and Domino 题目连接: http://www.codeforces.com/contest/611/problem/C Description They say "years are like dominoes, tumbling one after the other". But would a year fit into a grid? I don't think so. Limak is a little polar bear who loves…
B. New Year and Old Property 题目连接: http://www.codeforces.com/contest/611/problem/B Description The year 2015 is almost over. Limak is a little polar bear. He has recently learnt about the binary system. He noticed that the passing year has exactly on…
A. New Year and Days 题目连接: http://www.codeforces.com/contest/611/problem/A Description Today is Wednesday, the third day of the week. What's more interesting is that tomorrow is the last day of the year 2015. Limak is a little polar bear. He enjoyed…
题目链接:http://codeforces.com/problemset/problem/379/D [题目大意] 告诉你初始字符串S1.S2的长度和递推次数k, 使用类似斐波纳契数列的字符串合并的递推操作,使得最后得到的字符串中刚好含有x个"AC",现在要你构造出满足条件的S1和S2. [分析] 最终结果中有些"AC"可能是应为在合并时一个字符串的尾部和另一个字符串的首部合并而成,这就跟原始字符串的首尾字符有关,不同的情况在K次递推后多产生的"AC&q…
好久没有fst题了...比赛先A了前4题然后发现room里有人已经X完题了没办法只能去打E题,结果差一点点打完...然后C题fst掉了结果就掉rating 了...下面放题解 ### [A. New Year and Hurry](http://codeforces.com/problemset/problem/750/A) 题目大意:给定n道题和时间t,每完成第i道题需花$5*i$ 分钟,求在$240-t$分钟内完成的最大题数. 直接模拟,求完成i道题所花时间$t_i+t\leq 240$ 的…
咕bye 2018,因为我这场又咕咕咕了 无谓地感慨一句:时间过得真快啊(有毒 A.New Year and the Christmas Ornament 分类讨论后等差数列求和 又在凑字数了 #include<cstdio> #include<cstring> #include<algorithm> using namespace std; int a,b,c; int main() { scanf("%d%d%d",&a,&b,&…