codeforces round div2 915

CodeForces 数学类题目 做题汇总

# 写一下$3$月$28$日起开始做的题目感受: ## 1. CF1793B Fedya and Array: 普及- *1100 ### [Luogu链接](http://www.luogu.com.cn/problem/CF1793B) ### [CF链接](https://codeforces ......
CodeForces 题目 数学

Codeforces Round 690 (Div. 3)

# Codeforces Round 690 (Div. 3) https://codeforces.com/contest/1462 ## A. Favorite Sequence 按题意输出 ```CC #include using namespace std; const int N = 1e ......
Codeforces Round 690 Div

Codeforces Round 890 (Div. 2)

## Tales of a Sort >![image-20230806130431932](https://zeoy-typora.oss-cn-hangzhou.aliyuncs.com/image-20230806130431932.png) ### 题解 >* 找到最大的能够产生逆序对的数即 ......
Codeforces Round 890 Div

Codeforces Round 890 (Div. 2) supported by Constructor Institute ————C - To Become Max

关于这场div2,只能说一言难尽 C题可以二分的,赛时看到n 点击查看代码 ``` #include #define int long long using namespace std; const int N=1e6+7; int mod=1e9+7; int a[N]; int n,k; voi ......

Codeforces Round 890 (Div. 2) supported by Constructor Institute 题解

# A. Tales of a Sort 关键就是找逆序对 记一组逆序对下标为 $l,r$,则求出最大的 $a_l$ 即可 # B. Good Arrays 记要构造的 Good Array 为 $b$ 前置:$\forall 1\le i\le n,b_i=1$ 然后 $O(n)$ 扫一遍看一下有 ......

Codeforces Round 882 (Div. 2) 题解

# A. The Man who became a God 求出相邻两个元素的差值,去掉前 $m$ 个大的差值以后的差值和即为答案 # B. Hamon Odyssey 由按位与的性质可以知道,**前缀与和** 的值只会越来越小,只要和为 $0$ 的时候我们就清空按位与前缀和,增加一下次数,如果最终 ......
题解 Codeforces Round 882 Div

CodeForces 1856D More Wrong

[洛谷传送门](https://www.luogu.com.cn/problem/CF1856D "洛谷传送门") [CF 传送门](https://codeforces.com/problemset/problem/1856/D "CF 传送门") 直接求最大值不好求。我们可以采用一个交互常见的套 ......
CodeForces 1856D Wrong 1856 More

【反思】洛谷8月月赛 Div.2 & RiOI Round 2 赛后反思

## RiOI R2 赛后反思 赛时开了一个 T1, 但是 $0pts$, 然后就跑去跟人对线然后复盘(主要是我的锅,我忘记对线怎么开始的了)到了吃饭(雾 不过本来我也不会做,不能怪人家 赛后是 shenshen 教我 T1 + 看的若归老师的反思捏 推歌:歌爱ユキ&稲葉曇《キミに回帰缐》(希望没打 ......
月月 Round RiOI Div amp

CodeForces 1856E1 PermuTree (easy version)

[洛谷传送门](https://www.luogu.com.cn/problem/CF1856E1 "洛谷传送门") [CF 传送门](https://codeforces.com/problemset/problem/1856/E1 "CF 传送门") 考虑局部贪心,假设我们现在在 $u$,我们希 ......
CodeForces PermuTree version 1856E1 1856E

CodeForces 1856E2 PermuTree (hard version)

[洛谷传送门](https://www.luogu.com.cn/problem/CF1856E2 "洛谷传送门") [CF 传送门](https://codeforces.com/problemset/problem/1856/E2 "CF 传送门") 考虑局部贪心,假设我们现在在 $u$,我们希 ......
CodeForces PermuTree version 1856E2 1856E

【题解】PermuTree (easy version) - Codeforces 1856E1

**链接:** https://codeforces.com/contest/1856/problem/E1 **题目大意:** 给定一棵以节点 $1$ 为根的树,树的大小不超过 $n(1\leq n\leq 5000)$ ,给树的节点赋各不相同的权值(可以简化为某个 $[1,n]$ 的排列),使得 ......
题解 Codeforces PermuTree version 1856E1

【LGR-150-Div.2】洛谷 8 月月赛 I & RiOI Round 2

# [【LGR-150-Div.2】洛谷 8 月月赛 I & RiOI Round 2](https://www.luogu.com.cn/contest/122184) ## T1 [P9496 「RiOI-2」hacker](https://www.luogu.com.cn/problem/P9 ......
月月 Round RiOI LGR 150

2023年多校联训NOIP层测试4+洛谷 8 月月赛 I & RiOI Round 2

# [2023年多校联训NOIP层测试4](http://www.accoders.com/contest.php?cid=4467) # 爆零了 ![](https://cdn.luogu.com.cn/upload/image_hosting/snrb875y.png) ## T1 [幸运数字] ......
月月 Round 2023 NOIP RiOI

Codeforces Round 882 (Div. 2)

# Codeforces Round 882 (Div. 2) ## A The Man who became a God > 给定一个数组 $\{x_1,x_2,\cdots,x_n\}$ 和一个整数 $k$,记 $f(l,r)=\sum_{i=0}^{i \le r-l} |x_{l+i}-x_ ......
Codeforces Round 882 Div

Codeforces Round 885 (Div. 2) C. Vika and Price Tags

# C. Vika and Price Tags [C - Vika and Price Tags](https://codeforces.com/contest/1848/problem/C) **题意:** ​ 初始两串数列$a, b$,对于第$i$个数,令$c_i=|a_i-b_i|$,然后将 ......
Codeforces Round Price Vika Tags

Codeforces 1843D:Apple Tree

# [1843D.Apple Tree](https://codeforces.com/contest/1843/problem/D "Codeforces 1843D") ## Description: - 一棵树( $Tree$ 无环无重边 ) $n$ 个节点,根节点为1(节点编号 $1$~$n ......
Codeforces 1843D Apple 1843 Tree

【LGR-150-Div.2】洛谷 8 月月赛 I & RiOI Round 2

# 比赛实况 赛前看了眼难度分布,红橙黄绿,感觉随便杀(爆我) 顺序开题,先看 A 题,没仔细读,一眼以为单次操作只能翻转一位,写了个十进制转二进制找不同,结果 `WA` 了。 再看了一眼题,发现题干定义的操作可以一次操作很多位,然后一个操作是把 0 变 1,另一个是把 1 变 0。 所以只需要看两 ......
月月 Round RiOI LGR 150

【LGR-150-Div.2】洛谷 8 月月赛 I & RiOI Round 2

## T1 一直没有详细看过位运算的我瑟瑟发抖。出题人给了帮助(有用但是不多)。直接讲考试想法: 首先,手玩样例后,果断猜测:将两个数转化为二进制之后,把头对齐,然后找出不同位,再加上二者位数之差。结果:$0Pts$ 之后,又想了很久,发现了 按位与等价于将原来二进制数中的1变为0,按位或等价于将原 ......
月月 Round RiOI LGR 150

Codeforces Global Round 24 D. Doremy's Pegging Game

首先我们可以假设最后一个删除的peg编号是x,那么可以发现每个编号结尾的方案数是一样的,可以只专注计算最后删1号peg的方案数,然后乘一下就好 然对于1来说,我们需要找到一个(x, y) 的组合,x和y之间允许剩pegs,但是1到x,以及y到1之间的pegs都被移除,这个状态在此时依然没有触碰blu ......
Codeforces Pegging Global Doremy Round

Educational Codeforces Round 151

# [Educational Codeforces Round 151](https://codeforces.com/contest/1845) ## T1 就是大水题~~但写了很长时间~~。 构造题。首先分类讨论: 1. 当 $x\ne1$ 时我们构造的序列长度就为 $n$ ,序列就是 $n$ ......
Educational Codeforces Round 151

Practice on Codeforces and Atcoder in August

## [Educational Codeforces Round 151 A~E](https://www.cnblogs.com/oierpyt/p/17598936.html) ## [Codeforces Round #879 Div.2](https://www.cnblogs.com/oi ......
Codeforces Practice Atcoder August and

Educational Codeforces Round 151 (Rated for Div. 2) 题解

# A. Forbidden Integer 显然,当 $x\not=1$ 时,直接输出 $n$ 个 $1$ 即可 否则,如果 $n$ 为奇数,那就输出 $\lfloor\frac{n}{2}\rfloor-1$ 个 $2$ 和 $3$;如果 $n$ 为偶数,那就输出 $\frac{n}{2}$ 个 ......
题解 Educational Codeforces Round Rated

Codeforces Round 776 (Div. 3)(vp)

# [Dashboard - Codeforces Round 776 (Div. 3) - Codeforces](https://codeforces.com/contest/1650) ## A Deletions of Two Adjacent Letters **题意:看看与题目给的字符一 ......
Codeforces Round 776 Div vp

P9437 『XYGOI round1』一棵树 题解

赛时一眼换根 dp,然后调调调了大概 1h+。 [题目传送门](https://www.luogu.com.cn/problem/P9437) ### 什么是换根 dp 在大多数树形 dp 中,我们只考虑对根的贡献,而一部分题目需要算出对所有点的贡献,一个比较显然的做法是对每个点都跑一次树形 dp, ......
题解 round1 P9437 XYGOI round

Balanced Round 题解

[原题链接](https://codeforces.com/contest/1850/problem/D)。 #### 题目大意 给你一些数,问至少删掉多少数后两两不大于 k。 我们可以画图理解。 ![](https://cdn.luogu.com.cn/upload/image_hosting/9 ......
题解 Balanced Round

Codeforces Round 882 (Div. 2)

[link](https://codeforces.com/contest/1847) 题号:CF1847A~F ## [A](https://codeforces.com/contest/1847/problem/A) 题意: 给定一个数组 $\{x_1,x_2,\cdots,x_n\}$ 和一个 ......
Codeforces Round 882 Div

Codeforces 1850H:The Third Letter 带权并查集

# [1850H.The Third Letter](https://codeforces.com/contest/1850/problem/H "Codeforces 1850H") ## Description: - $n$ 个人,$m$ 个条件,每次给出两个人 $a_i$ 和 $b_i$ 一维 ......
Codeforces Letter 1850H Third 1850

Codeforces Round 882 (Div. 2)

# [Codeforces Round 882 (Div. 2)](https://codeforces.com/contest/1847) ## [A.The Man who became a God](https://www.luogu.com.cn/problem/CF1847A) ### 题 ......
Codeforces Round 882 Div

【反思】Sadness Fan Club Round 3 赛后反思

## Sadness Fan Club Round 3 赛后反思 被薄纱了: ![图挂了就是没有了](https://cdn.luogu.com.cn/upload/image_hosting/15gl6gr2.png) 推歌:Bao The Whale《Cirtus Love》 小鲸鱼粉色那个皮好 ......
Sadness Round Club Fan

Codeforces Round 424 (Div. 1)D. Singer House

[传送门](https://codeforces.com/problemset/problem/830/D) 显然要自底向上进行$dp$ 深度相同的子树结构相同所以可以利用深度来代表子树。 那么就应该统计出有向路径的个数。 考虑路径由链所拼成。那么状态里应该有有向链的条数。 设$f_{i,j}$表示 ......
Codeforces Singer Round House 424