codeforces blame 1829 don

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

Don't be clever

![](https://img2023.cnblogs.com/blog/474029/202308/474029-20230803214759188-444633570.png) ![](https://img2023.cnblogs.com/blog/474029/202308/474029-2 ......
clever Don 39 be

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

Codeforces Round 889 (Div. 2)

# [Codeforces Round 889 (Div. 2)](https://codeforces.com/contest/1855) ## T1 ​ 思路:我们将 $i \ne p_i$ 的数量记下来,再判断这个数的奇偶性,如果为偶,那么答案就为这个数 / 2,如果为奇,那么就是这个数 / ......
Codeforces Round 889 Div

Codeforces Round 885 (Div. 2) 题解

# A. Vika and Her Friends 看一下样例就可以发现,Vika 以及她的朋友都不能走对角线,在这种情况下 Vika 和朋友的距离为 **偶数**,且朋友一定追不上 Vika 所以直接判断 Vika 和朋友的距离是否都为偶数即可 # B. Vika and the Bridge 显 ......
题解 Codeforces Round 885 Div

Codeforces Round 887 (Div. 2)

# [Codeforces Round 887 (Div. 2)](https://codeforces.com/contest/1853) ## [A. Desorting](https://codeforces.com/contest/1853/problem/A) ### 题目大意 给出一个长 ......
Codeforces Round 887 Div

Codeforces Round 885 (Div. 2)

# [Codeforces Round 885 (Div. 2)](https://codeforces.com/contest/1848) ## [A. Vika and Her Friends](https://codeforces.com/contest/1848/problem/A) ### ......
Codeforces Round 885 Div

Codeforces Round 885 (Div. 2)

# Codeforces Round 885 (Div. 2) ## A. Vika and Her Friends ​ 考虑 Vika 和其中一个朋友的距离,Vika 走一步,他们的距离要么加一要么减一;朋友也一样。那么每秒后他们的距离,要么不变,要么 ±2。那么与 Vika 距离为奇数的朋友,永 ......
Codeforces Round 885 Div

Codeforces Round 887 (Div. 2)

# Codeforces Round 887 (Div. 2) ## T1 ​ 如果已经是无序直接输出零,如果有序, 找到前后相差最小的两个数, 答案 $$ ans = \min\{a_{i+1}-a_i\}/2+1 $$ ## T2 ​ 给定 $n$ 和 $k$ ,问有多少单调不降且非负的斐波那契 ......
Codeforces Round 887 Div

Practice on Codeforces and Atcoder in July

## [$1844E$](https://codeforces.com/problemset/problem/1844/E) 题意: 定义一个矩形 $a$ 是好的,当且仅当其满足以下条件: 1. 矩形中每一个元素 $x$ 都为 $A,B,C$ 其中之一 2. 每一个 $2\times 2$ 的子矩形 ......
Codeforces Practice Atcoder July and

Practice on Codeforces and Atcoder in June

# $Practice$ $on$ $codeforces$ $in$ $June$ wk,误删了4个题,但我不想补了 ## [$CF1839D$](https://codeforces.com/contest/1839/problem/D) 题意:给一个正整数序列 $a$,给定 $k$ 个 0,将 ......
Codeforces Practice Atcoder June and

Educational Codeforces Round 151 A~E

前言:F是个FFT,不想写。 ## [A-Forbidden Integer](https://www.luogu.com.cn/problem/CF1845A) 你需要构造一个正整数序列,满足: 1. 对于 $i$,$a_i\le k$ 且 $a_i\not=x$。 2. $\sum a_i=n$ ......
Educational Codeforces Round 151

Practice on Codeforces and Atcoder in May

# CF补题题解2023.5 说明:CF题直接去luogu看翻译,AT题会附上简要题意 ## [CF1821E](https://codeforces.com/contest/1821/problem/E) 先考虑如何高速计算权值 一个显而易见的贪心是尽量在右边取括号消除,设右括号为 1,左括号为 ......
Codeforces Practice Atcoder May and

Codeforces Round 887 (Div. 2) 题解

# A. Desorting 题目的核心操作就是选定一个位置 $i$,使得: - 对于所有 $j\le i$,$a_j\leftarrow a_j+1$ - 对于所有 $j>i$,$a_j\leftarrow a_j-1$ 这样一来,操作后 $a_{i+1}-a_i$ 的值就会 $-2$ 因为 $a ......
题解 Codeforces Round 887 Div

Educational Codeforces Round 152 (Rated for Div. 2) D. Array Painting

初始所有点都是蓝色的,给定一个数组,每个元素为0,1,2等值,两种操作,选定一个点花1元变红,或者选定一个为1或者2的红色点,减去一个价值,让周围的点变红,最后所有点都要变红 思路:贪心,对于一个数组来说我们找寻连续的不等于0的一段,判断每一段最多所能变红的 存在两种情况 010,这种情况花1可以最 ......
Educational Codeforces Painting Array Round

Educational Codeforces Round 152 (Rated for Div. 2) C. Binary String Copying

题目大意为给定一个01字符串,给定m个区间,对于每个区间进行一次局部排序,求能得到的字符串种类数 解法:因为字符串只包含0,1两个字符,我们观察可以得到,对于不同的区间来说如果排序后一样则说明肯定是某些位置在排序过程中无贡献,因此我们只需找出有贡献的位置即可 对于一个区间[l,r],来说,如果进行排 ......
Educational Codeforces Copying Binary String

Educational Codeforces Round 152 (Rated for Div. 2) B. Monsters

题目大意为给定一个伤害k,n个怪物,hp为hp[i],每次都攻击hp最高的怪物,输出怪物的死亡顺序,如果攻击次数一样则按序号由小到大 解法:每次攻击都选最大的,假设hp=k*m+r,我们可以得到当进行m次攻击后,hp只有剩余数,再进行一次攻击怪物就会死亡,因此我们只需按余数由小到大排序即可,注意余0 ......
Educational Codeforces Monsters Round Rated

Codeforces Round 888 (Div. 3)

比赛链接:https://codeforces.com/contest/1851 ## A. Escalator Conversations 题意:一个扶梯,共m阶,n人站,每个台阶高k,Vlad身高H,Vlad任意站,问有多少人站在这个扶梯上正好和Vlad齐平 满足`abs(H - h[i]) % ......
Codeforces Round 888 Div

Codeforces Round 889 (Div. 2)

[TOC] ### 写在前面 我是飞舞。 ### A 随便做。 ### B 发现每一个长度为 $i$ 的区间中至少有 1 个 $i$ 的倍数,于是仅需检查能整除 $n$ 的最长的 $1\sim n$ 的前缀即可。 ### C1/C2 一个显然的想法是先让所有数同正/同负,再做前缀和/后缀和。 如果某 ......
Codeforces Round 889 Div

Codeforces Round 889 Div.2 A-F

前言:wssb ## [Dalton the Teacher](https://codeforces.com/contest/1855/problem/A) 题意:给定一个排列,每次可以交换两个元素,求使得 $\forall i\in[1,n],a_i\neq i$ 的最小操作数。 一次可以操作两个 ......
Codeforces Round 889 A-F Div