![](https://img-blog.csdnimg.cn/20201014180756916.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
cf
余西子
这个作者很懒,什么都没留下…
展开
-
Codeforces Round #118 (Div. 1) A. Plant 矩阵快速幂(矩阵构造) 模板
A. Planttime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputDwarfs have planted a very interesting plant, which is a triangle direct...原创 2018-08-10 19:37:11 · 145 阅读 · 0 评论 -
E. Demiurges Play Again Codeforces Round #300 思维
题目链接:http://codeforces.com/problemset/problem/538/E题意: 给你一棵根为1的树,现在点1的位置上有一个球,两个人A和B轮流将球往下一层推,直到不能再推为止,假设这棵树一共有m个叶子结点,你可以在这m个结点上随意的放上数字1-m,在你放完之后,A和B开始推球,A希望球最后停的叶子上的数字越大越好,B希望这个数字越小越好,由A...原创 2019-04-30 10:38:45 · 138 阅读 · 0 评论 -
Codeforces Round #547 (Div. 3) F2. Same Sum Blocks (Hard)
题目链接:http://codeforces.com/contest/1141/problem/F2题意: 给你一个长度为n的数字串,块 (block) 的定义为一段连续的数字串上的和,现在要你找最多的不相交的块,让他们的和为相同。如果有多个答案,任意输出即可。做法: 因为数据量N<=1500,所以就算是单个枚举,也只有1e6个区间及区间和...原创 2019-03-28 09:50:22 · 103 阅读 · 0 评论 -
Educational Codeforces Round 57 (Rated for Div. 2) F. Inversion Expectation 概率+逆序对
题目链接:http://codeforces.com/contest/1096/problem/F 题意:给你一个n个数的排列,但是在这个排列中有一些数字被-1覆盖。问你这个排列中逆序对的期望是多少。 自己想也只能想到一个部分,还是去网上看了人家的题解做出来的,其实也不是特别难,缺少想法吧。做法: 这个逆序对的个数由四个部分组成,假设我们有m个未知数。 ...原创 2019-02-26 10:12:15 · 134 阅读 · 0 评论 -
Codeforces Round #528 (Div. 1 D. Rock-Paper-Scissors Champion 树状数组+思维
链接:http://codeforces.com/contest/1086/problem/D题意: 给你一个n长度的SRP组成的字符串,分别代表石头剪刀布,每次随机选取相邻的两个人进行对决,失败的一方退出队伍,相同则随机取一人退出,n-1次操作后剩下的那个人胜利。现在有q个询问,要你输出q+1个数字,每次询问会给你一个修改pos C,代表pos位置上的这个要修改成出C这个字...原创 2019-03-01 14:03:47 · 192 阅读 · 0 评论 -
Educational Codeforces Round 60 (Rated for Div. 2) D. Magic Gems 矩阵快速幂
题目链接:http://codeforces.com/contest/1131/problem/D 题意:给你n个位置,每个位置上有一个宝珠,原宝珠(未分解的)都用1表示。现在你可以将连续的m个宝珠变成0(不得重叠),问最后构成n个位置宝珠的01串有几种方法。 1<=n<=1e18,1<=m<=100. 很明显,是要从不大的m下手作文章。也比较容易想...原创 2019-02-24 09:33:38 · 121 阅读 · 0 评论 -
Codeforces Round #319 (Div. 2) E. Points on Plane 莫队+优化
E. Points on Planetime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputOn a plane are n points (xi, yi) with integer coordinates betw...原创 2018-08-13 11:41:37 · 223 阅读 · 0 评论 -
C - Ahmad and Spells Gym - 101502C 尺取+思维
C. Ahmad and Spellstime limit per test1.0 smemory limit per test256 MBinputstandard inputoutputstandard outputAhmad has recently started playing a new game called DotA (Defense of th...原创 2018-08-13 09:56:23 · 351 阅读 · 0 评论 -
Gym - 101502 D. Dice Game 思维+dp
D. Dice Gametime limit per test1.0 smemory limit per test256 MBinputstandard inputoutputstandard outputA dice is a small cube, with each side having a different number of spots on it...原创 2018-08-11 08:31:35 · 589 阅读 · 0 评论 -
Codeforces Round #182 (Div. 1) D Yaroslav and Divisors1 树状数组
题目链接:http://codeforces.com/contest/301/problem/D题意: 给你 n个数,m个询问,每次询问你,在li到ri这个区间内有多少对数xi,xj(xi<=xj)使得xi是xj的因子,如 2 4 7中 区间[1,2]里,2是4的因子,2是自己的因子,4也是自己的因子。做法: 想了bitset与,但是空间...原创 2019-05-07 21:59:29 · 136 阅读 · 0 评论