codeforces partition artistic 1603

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

Codeforces Round 887 (Div. 1)

# Preface 补一篇好久之前打的CF的博客,说实话其实B题我当时怎么想的已经忘的七七八八了 这场第一眼看A没啥思路,就先去把B这个构造写了,中间想了挺久的大概40min才写出来 然后回头一看A发现可以倒着做,就是个丁真题了然后15min写完 后面看C刚开始以为是个贪心,后面又感觉是个DP,但状 ......
Codeforces Round 887 Div

Codeforces Round #879 Div.2

[link](https://codeforces.com/contest/1834) 前言:VP了一把,rk731,如果赛上有这发挥就好了。 果然,D是分水岭,一直都是。 ## [Unit Array](https://codeforces.com/contest/1834/problem/A) ......
Codeforces Round 879 Div

Educational Codeforces Round 88

# A. Berland Poker 先尽可能的吧小丑给一个人,在把剩下的小丑尽可能的平分,最后计算差值即可。 ```cpp #include using namespace std; void solve() { int n, m, k, t; cin >> n >> m >> k, t = n ......
Educational Codeforces Round 88

Educational Codeforces Round 104

https://codeforces.com/contest/1487 # A. Arena 统计与最小值不同的数字数量。 ```cpp #include using namespace std; #define int long long const int M = (1 > n; vector ......
Educational Codeforces Round 104

Codeforces Round 889 (Div. 2) A-E

[传送门,不用谢。](https://codeforces.com/contest/1855) A 给出排列每次可以交换两个数字,求最少多少次使得排列为错排。 考虑在原位的数字个数为$cnt$ 则答案显然为$(cnt+1)>>1$ B 求一个最大区间满足其中说有数字被$n$整除 极其有趣,注意到样例 ......
Codeforces Round 889 A-E Div

Codeforces Round 889 (Div. 2) A-D

## A. Dalton the Teacher 题意:给出一个排列,问使得排列变为1,2,...,n的最小的交换操作次数 ### Solution 统计a[i]!=i的个数,答案就是除以二向上取整 ```c++ void solve() { int n;cin>>n; int res=0; for ......
Codeforces Round 889 A-D Div

Educational Codeforces Round 36 (Rated for Div. 2)

# Educational Codeforces Round 36 (Rated for Div. 2) https://codeforces.com/contest/915 浓浓ds味的一场edu ## A. Garden 找最大因子 ```CC #include using namespace ......
Educational Codeforces Round Rated Div

Educational Codeforces Round 152 (Rated for Div. 2)

# Preface 经典秒完SB题然后开始坐牢1h,写了个E的假算法T在24个点就不管了打lol去了 妈的怎么稍微难点的题就是想不到呢 # A. Morning Sandwich 签到 ```cpp #include #include #include #include #include #incl ......
Educational Codeforces Round Rated 152