最近公共祖先
最近公共祖先
Codeforces 个人训练
标签: 算法
Codeforces Day1Codeforces 训练 Day1Codeforces 1288 A Deadline思路Codeforces 1288 B Yet Another Meme Problem思路Codeforces 1288C Two Arrays思路Codeforces 1288E Messenger Simulator思路 Codeforces 训练 ...
HOME:首页,每场比赛的介绍。TOP:基本上是CATALOG大佬们展示出来的博客、资料,每场比赛的榜单和题解。CONTESTS:比赛系统,接下来会介绍。GYM:健身房,里面是一些比赛真题,难度较高,建议三人成行或者有较高的...
半个多月没训练了,这要上课了,先恢复训练一下hhh这是一道很简单的思维。
标签: c++
Codeforces思维题训练
标签: 算法
3.如果对于搜索进行最优剪枝,也可也变成dp 但是为何不直接用dp?dp之所以快于搜索,因为搜索会进行根本到不了结果的道路。2.dp的模板 (1)单调 (2)无后效性 (3)在前面两个中选择。1.dfs与bfs有2的1000次方种...
数学,预处理
最近codeforce打的不是很好,所以专门进行一次训练,下面题目的难度全在1900−21001900-21001900−2100难度区间。 CF1475G Strange Beauty 题目链接:CF1475G Strange Beauty 题目大意:给定一个数组,求最少删去多少...
Educational Codeforces Round 90 (Rated for Div. 2) D. Maximum Sum on Even Positions 解题思路:首先将问题的多种不同情况列出来,发现有两种情况。 这种数组的问题好像经常会有差分数组的构造。,下次解不出来...
思路:这道题用到了缩点的思想,比如说000111000111做reverse达到非降序的操作次数与0101是相同的,并且00000101和101的操作数也相同,所以说在左边添加零对操作数无影响,当输入字符串是“?怎么办呢,在左边加0并...
n的时候不能构成,当n>=4的时候,先降序放奇数,放完后从 4 , 2 开始,然后升序放偶数即可。做的时候什么也想不到,看了别人的思路才发现自己太傻了,原来这道题能这么简单。
题目链接 Description Yaroslav, Andrey and Roman can play cubes for hours and hours. But the game is for three, so when Roman doesn’t show up, Yaroslav and Andrey play another game. ...
Description The clique problem is one of the most well-known NP-complete problems. Under some simplification it can be formulated as follows. Consider an undirected graph G. It is required to find a s...
只要理解了题目就不难写出题解,因为博主目前只学了一些c++的基础,所以写了一堆。
2n + 1, 3n - 1], 这段一共 n - 1 个数。[n + 1, 2n - 1], 这段一共 n - 1 个数。[1, n - 1], 这段一共 n - 1 个数。
题目链接 Description Leonid wants to become a glass carver (the person who creates beautiful artworks by cutting the glass). He already has a rectangular w mm × h mm sheet of glass, a diamond ...
题目链接 Description Do you like summer? Residents of Berland do. They especially love eating ice cream in the hot summer. So this summer day a large queue of n Berland residents lined up in front of ...
程序设计竞赛相关代码、设计文档、使用说明,供学习参考 程序设计竞赛相关代码、设计文档、使用说明,供学习参考 程序设计竞赛相关代码、设计文档、使用说明,供学习参考 程序设计竞赛相关代码、设计文档、使用说明...
A B C D E F G H
题目链接 Description Some days ago, I learned the concept of LCM (least common multiple). I’ve played with it for several times and I want to make a big number with it. But I also don’t want to use ...
Description There are n cities in Westeros. The i-th city is inhabited by ai people. Daenerys and Stannis play the following game: in one single move, a player chooses a certain town and burns it to t...
题目链接 Description Daniel is organizing a football tournament. He has come up with the following tournament format: In the first several (possibly zero) stages, while the number of teams is even, ...
比赛链接 A.The Game Of Parity Description There are n cities in Westeros. The i-th city is inhabited by ai people. Daenerys and Stannis play the following game: in one single move, a player chooses a ...
比赛链接 A.Stadium and Games 题目链接 Description Daniel is organizing a football tournament. He has come up with the following tournament format: In the first several (possibly zero) stages, while ...
题目链接 Description You have a rectangular n × m-cell board. Some cells are already painted some of k colors. You need to paint each uncolored cell one of the k colors so that any path from the ...
显然,对于L = b-a+1,是满足题意的,我们从x=a开始检索,显然,检索a的时候,L的值为b-x+1,这时先比较L和前面的所得的能到达的L的最小值minres,若小于minres,显然不能该L值及其往下不能作为结果,反之,则寻找sum...
时间 场次 过题数目 补题数目 难易度 2019.4.7 codeforces-1141 (div3) 7/7 7/7 easy 2019.4.7 codeforces-1140 (div2) ...
那么长度为m的数组b,就相当于数组a的一个长度为m的滑动窗口,且滑动窗口中的最大值与最小值即a[l],a[l+m]的差的绝对值小于m。如果选定l=2,r=3,在反转后是a={2,1,3,5,4},[1,l-1]与[r+1,n]即[1,1]与[4,5]的元素互换...
lucifer1004大佬的博客cf上分攻略故里大佬的githubcf思维题刷题数:44- (1421)codeforces 676 div2 A,B done