codeforces goblins gnomes 1525f

Codeforces Round 890 (Div. 2) A-E1

## A. Tales of a Sort 题意:给出一个长为n的数组a,每次操作可以使得所有的数-1,最小不会小于0,问至少需要多少次操作才能使得a变得有序。 ### Solution 把数组a排序,从大到小遍历,如果当前的$a[i]$不是原来的话,那么要想让它有序,必须进行当前的$a[i]$次操 ......
Codeforces Round 890 A-E Div

Codeforces Round 890 (Div.2)

赛时没想到c是二分答案 ## C. To Become Max ### 题意 给定一个长度为$n$的数组$a$,可对$a_i$加1当$a_i\le a_{i+1}$,最多可进行$k$次这样的操作,求最多$k$次操作后数组$a$中的最大值。 ### 思路 首先找出原数组中最大的值,然后枚举1到n-1, ......
Codeforces Round 890 Div

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

# Preface 现在开始严格按照**双号上分法**来打CF了,大致就是每次比赛都拿两个号中分较少的那个打,这样可以保证两个号的最高分不降 然后昨天打完就后悔了,没有拿*hl666*那个号打导致没抓住难得的上分机会,本来可以打到橙名渡劫局的但分全加在*Kusanagi_Misuzu*那个号上了 不 ......

【题解】Codeforces Round 890(CF1856)

赛时过了 A-E1,rk195 可惜是 E2 傻逼了不会背包优化了,直接连普及组水平都不到了。 ## A.Tales of a Sort ### 题目描述: 给定长度为 $n$ 的序列 $a$,每次操作为对于所有 $i$ 将 $a_i$ 变为 $\max(a_i-1,0)$,询问最少多少次操作之后可 ......
题解 Codeforces Round 1856 890

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

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

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

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

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

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

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

Codeforces Round 827 (Div. 4)

# [Dashboard - Codeforces Round 827 (Div. 4) - Codeforces](https://codeforces.com/contest/1742) ## A Sum 简单题 ```c++ void solve() { int a, b, c; cin >> ......
Codeforces Round 827 Div

Codeforces 1855B:Longest Divisors Interval 最长的连续约数区间

# [1855B.Longest Divisors Interval](https://codeforces.com/contest/1855/problem/B "Codeforces 1855B") ## Description: - 对于一个整数 $n$ $(1\leq n \leq 10^{ ......
约数 区间 Codeforces Divisors Interval

Codeforces Round 449 (Div. 1) D. Nephren Runs a Cinema 卡特兰数

[luogu链接](https://www.luogu.com.cn/problem/CF896D) 题意不再赘述。 优先枚举的应该是$VIP$用户,枚举范围应该是$[0,n-l]$ 之后总客户数为$s=n-i$ 再考虑枚举$100$的总人数为$x$ 则要求$s-2x\in [l,r]$ 这部分方案 ......
卡特兰 Codeforces Nephren Cinema Round

Educational Codeforces Round 38 C- F

# Educational Codeforces Round 38 C - F https://codeforces.com/contest/938 今天写出了三题ovo ## C. Constructing Tests 多画几个图就能发现,对于 $n\times n$ 的正方形来说,要使得 $m\ ......
Educational Codeforces Round 38