![](https://img-blog.csdnimg.cn/20201014180756913.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
题解
文章平均质量分 86
nsu_zser
acm萌新,,
展开
-
2018 蓝桥杯省赛 B 组模拟赛(五)
计蒜客蓝桥杯省赛 B 组模拟赛网址 https://www.jisuanke.com/contest/1215A题:矩阵求和给你一个从 n×n 的矩阵,里面填充 11 到 n×n 。例如当 nn 等于 33 的时候,填充的矩阵如下。1 2 34 5 67 8 9现在我们把矩阵中的每条边的中点连起来,这样形成了一个新的矩形,请你计算一下这个新的矩形的覆盖的数字的和。比如,n = 3n=3 的时候矩...原创 2018-04-18 17:12:46 · 484 阅读 · 0 评论 -
codeforces 1197D. Yet Another Subarray Problem 动态规划
题意 :给你n个数,还有m和k,让你找一个区间使这个公式的值最大 其中⌈x⌉是对x向上取整,l和r是所选的区间的左右下标。思路 :定义一个dp[i][j],表示第i个数作为右端点,区间长度对m取余为j的最大值。那么就可以得到转移方程:dp[i][j%m]=max(a[i]-k,dp[i-1][0]+a[i]-k );///当j等于1时dp[i][j%m]=dp[i-1][(j-1+...原创 2019-07-23 10:04:31 · 222 阅读 · 0 评论 -
bzoj1022 约翰的游戏 反SG-博弈
附上原题链接https://www.lydsy.com/JudgeOnline/problem.php?id=1022反SG博弈 的SJ定理。先说结论 先手获胜的条件有两个:1.异或和等于0 并且对于每组小游戏的SG值全都小于等于1。2.异或和不等于0 并且对于每组小游戏存在SG值大于1。证明,先说第一种情况 。因为异或和等于1并且SG值全都小于等于1 先手只需要把其...原创 2019-05-20 10:08:01 · 286 阅读 · 1 评论 -
codeforces 1029E. Tree with Small Distances
题意: 给你一个n 表示有n个点组成的一棵树,接下来输入的是n-1条边 。1是这棵树的根节点。现在要求每个节点到根节点的距离要小于等于2。问:最少要连几根线才能满足要求。 思路 :贪心一下 找到距离不符合的叶子节点然后 然后把叶子节点的父亲连接到根节点。再去更新与这个父亲节点相连的点,这时会出现新的叶子节点。。才开始写的时候没写好出现新的叶子节点没找好wa了30次。。。。。题面...原创 2018-09-02 14:26:32 · 309 阅读 · 0 评论 -
codeforces 1037E .Trips
题意 :给你一个n,m,k。表示有n个人,有m天。现在他们要出去玩,在出去玩的这些人里每个的朋友要大于等于k人才能出去玩(当然朋友是不能传递的 比如a和b是好基友 a和c是好基友 但b和c是不是基友就不一定了)。一开始每个人都是没有朋友的,接下来m行 每行输入x和y,表示这一天x和y成为了好盆友。现在要输出m行 每行表示这一天最多能有多少人出去玩。思路 :先来到最后一天第m天 ,相当于把全部边...原创 2018-09-04 09:01:28 · 353 阅读 · 0 评论 -
A. Restoring Numbers
http://http://codeforces.com/gym/101755/problem/AA. Restoring Numberstime limit per test2.0 smemory limit per test256 MBinputstandard inputoutputstandard outputPavel had two positive integers a and b....原创 2018-04-20 11:18:19 · 264 阅读 · 0 评论 -
L. Queries on a String
http://codeforces.com/gym/101755/problem/LL. Queries on a Stringtime limit per test2.0 smemory limit per test256 MBinputstandard inputoutputstandard outputA string s is given. Also there is a string p...原创 2018-04-23 12:27:36 · 327 阅读 · 0 评论 -
J. Parallelograms
http://http://codeforces.com/gym/101755/problem/JJ. Parallelogramstime limit per test2.0 smemory limit per test256 MBinputstandard inputoutputstandard outputThere are n sticks, the i-th of which has l...原创 2018-04-23 11:42:26 · 165 阅读 · 0 评论 -
E. Substring Reverse
http://http://codeforces.com/gym/101755/problem/EE. Substring Reversetime limit per test2.0 smemory limit per test256 MBinputstandard inputoutputstandard outputTwo strings s and t of the same length a...原创 2018-04-23 11:36:56 · 383 阅读 · 0 评论 -
H. Safe Path
http://http://codeforces.com/gym/101755/problem/HH. Safe Pathtime limit per test2.0 smemory limit per test256 MBinputstandard inputoutputstandard outputYou play a new RPG. The world map in it is repre...原创 2018-04-23 11:31:22 · 369 阅读 · 0 评论 -
C. Third-Party Software
http://codeforces.com/gym/101755/problem/CC. Third-Party Softwaretime limit per test2.0 smemory limit per test256 MBinputstandard inputoutputstandard outputPavel is developing a game. To do that, he n...原创 2018-04-23 11:19:01 · 337 阅读 · 0 评论 -
codeforces 1221E. Game With String 不平等博弈
题意 :T组数据 , 对于每组有一个字符串由'X'和'.'组成。现在爱丽丝和鲍勃轮流玩游戏,爱丽丝先操作。对于每次操作爱丽丝可以把连续的a个'.'变成'X',鲍勃可以把连续的 b个'.'变成'X' 。(输入保证a大于b)谁不能操作谁就输。先把每段连续的‘.’处理出来存在数组num里面。思路 :因为a总是大于b,所以这是一个 不平等博弈 。对于这个不平等博弈,我一来就在想先手必胜或者后...原创 2019-09-22 15:54:16 · 483 阅读 · 0 评论