codeforces blame 1829 don

CodeForces 888F Connecting Vertices

[洛谷传送门](https://www.luogu.com.cn/problem/CF888F "洛谷传送门") [CF 传送门](https://codeforces.com/problemset/problem/888/F "CF 传送门") 做做简单题放松身心。 考虑区间 dp,设 $f_{i ......
CodeForces Connecting Vertices 888F 888

Codeforces Round 889 (Div. 1)

# Preface 由于一轮集训最后一周题目难度变大加上要写专题补专题导致欠了很多的博客没写,接下来慢慢把它们补上吧 ~~才不是因为天天溜会寝室看LPL呢,我发誓~~ 顺序的话就倒着来好了,先从最后的这场收尾的CF补起好了 这场其实刚开始就被A1,A2卡的很难受,大概1h左右过了之后一直在刚B,其实 ......
Codeforces Round 889 Div

《莫生气》 外文名《Don't be angry》

人生就像一场戏,因为有缘才相聚。 相扶到老不容易,是否更该去珍惜。 为了小事发脾气,回头想想又何必。 别人生气我不气,气出病来无人替。 我若气死谁如意,况且伤神又费力。 邻居亲朋不要比,儿孙琐事由他去。 吃苦享乐在一起,神仙羡慕好伴侣。 中文名《莫生气》 外文名《Don't be angry》 启 ......
angry Don 39 be

Codeforces Round 888 (Div. 3) 补题

- 独立补了一道记忆化搜索的题,https://codeforces.com/contest/1851/problem/E 由于初次接触对于使用场景和注意事项都不是很熟悉,写加调估计得有3h。 # 本题的题面保证了本题是个无环图,允许dfs函数会有出口,存图不能用链式前向图,因为非常容易构造数据使得 ......
Codeforces Round 888 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 1648E Air Reform

[洛谷传送门](https://www.luogu.com.cn/problem/CF1648E "洛谷传送门") [CF 传送门](https://codeforces.com/problemset/problem/1648/E "CF 传送门") 被一道题创了三天![](//图.tk/0) 我们 ......
CodeForces Reform 1648E 1648 Air

Codeforces Round 888 (Div. 3)

# [传送门](https://codeforces.com/contest/1851) ### A Escalator Conversations 读懂题意即可 ``` /* Author : north_h File : A.cpp Time : 2023/7/26/12:32 _ _ _ _ ......
Codeforces Round 888 Div

Codeforces Round 889 (Div. 2)

# Codeforces Round 889 (Div. 2) A-D https://codeforces.com/contest/1855 打的太烂了,决心好好复盘 ## A. Dalton the Teacher ```CC #include using namespace std; void ......
Codeforces Round 889 Div

Codeforces Round 889 (Div. 2) C1 - C2

[Problem - C1 - Codeforces](https://codeforces.com/contest/1855/problem/C1) [Problem - C2 - Codeforces](https://codeforces.com/contest/1855/problem/C2 ......
Codeforces Round 889 Div C1

Codeforces #889 div2 B

### [B. Longest Divisors Interval](https://codeforces.com/contest/1855/problem/B) **做法:**假设我们找到了一个最大区间``[l, r]``,这个区间的长度为``k``,那么这个区间里有一个数必定是``k``的倍数( ......
Codeforces div2 889 div

Codeforces Round 889 (Div. 2) 题解

$6$ 题只做出来 $1$ 题,损失惨重 # A. Dalton the Teacher 显然,答案一定和最初的不满意人数有关,所以输入的时候统计一下 然后,将不满意的人的座位 **每两个人交换一次** 即可,交换次数就是答案 如果不满意人数是奇数,那么答案还要加 $1$ 时间复杂度 $O(n)$( ......
题解 Codeforces Round 889 Div

Codeforces Round 889 (Div. 1) 题解

# A1. Dual (Easy Version) https://codeforces.com/contest/1854/problem/A1 ## 题意 给定一个长度为 $n$ 的序列 $a_1, a_2, \dots, a_n$,你可以做以下操作: - 选定两个下标 $i, j(1 \leq ......
题解 Codeforces Round 889 Div

【题解】Earn or Unlock - Codeforces 1854B

https://codeforces.com/contest/1854/problem/B 看了官方题解才大概懂的。 先设想一个前提,如果要求你最后开了恰好x张牌,并且x=n的,只是没有那么多牌开了,导致白白损失了开牌次数。 为了统一这一种情况,可以在牌堆后面补上若干个为值为0的虚拟的牌,和上面的问 ......
题解 Codeforces Unlock 1854B Earn

Codeforces Round 105 (Div. 2) - D. Bag of mice DP 或 记忆化搜索 求概率

# [D. Bag of mice](https://codeforces.com/contest/148/problem/D) ## 题意 待补充~ ## 思路 可利用 DP 或者记忆化搜索求解本问题,实际上这两个方法等价。 ## 代码 - 记忆化搜索 ```cpp //>>>Qiansui #i ......
概率 Codeforces 记忆 Round mice

【题解】Educational Codeforces Round 149(CF1837)

一直不会 E 这种题,看到就晕,没想到 F 是个简单题[疑问] ## A.Grasshopper on a Line ### 题目描述: 给定两个整数 $x$ 和 $k$。蚂蚱从 $0$ 点出发,沿着数轴上的 $OX$ 轴进行跳跃,每次可以向左或向右跳跃一定距离(距离必须为整数),但是不能跳到距离为 ......
题解 Educational Codeforces Round 1837

Educational Codeforces Round 152 (Rated for Div. 2)

[传送阵](https://codeforces.com/contest/1849) ## [T1 Morning Sandwich](https://codeforces.com/contest/1849/problem/A) ### 题目大意 $t$ 个测试,每个测试给三个正整数 $b,c,h$ ......
Educational Codeforces Round Rated 152

Codeforces Round 888 (Div. 3)

## Codeforces Round 888 (Div. 3) ### T1 ​ 思路:直接模拟。 ### T2 ​ 思路:首先记录原始数组的奇偶性,然后将奇数、偶数分为不同两组进行排序,然后再根据原数组的奇偶性按顺序填入奇数偶数,最后判断整个数组是否非递减。 ### T3 思路:我们已知开始在 ......
Codeforces Round 888 Div

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

$6$ 题做出来 $3$ 题,这一次的 D 题没能复刻上一次 Round 888 Div. 3 最后几分钟 AC 的奇迹 # A. Morning Sandwich 大水题,5min时间4min都在翻译题面 直接拿 $b$ 和 $c+h$ 进行比较分类讨论即可 单次操作时间复杂度 $O(1)$ # ......
题解 Educational Codeforces Round Rated

Educational Codeforces Round 152 (Rated for Div. 2)(A~D)

感觉代码越写越丑了...... 但能过题就是了 A. Morning Sandwich 莫诺卡普总是用美味的三明治开始他的早晨。莫诺卡普做的三明治总是由面包、奶酪和/或火腿组成。 三明治总是遵循以下公式 一块面包 一片奶酪或火腿 一块面包 …… 一片奶酪或火腿 一块面包 因此,面包总是放在顶部和底部 ......
Educational Codeforces Round Rated 152

Educational Codeforces Round 152 (Rated for Div. 2)记录

A. Morning Sandwich #include <cstdio> #include <algorithm> #include <cmath> #include <vector> #include <string.h> #include <set> #include <string> #in ......
Educational Codeforces Round Rated 152

Educational Codeforces Round 76 (Rated for Div. 2)

Educational Codeforces Round 76 (Rated for Div. 2) A - Two Rival Students 思路:最多可加x个距离,且最后的距离不能超过n-1 #include<bits/stdc++.h> using namespace std; #defi ......
Educational Codeforces Round Rated Div

Educational Codeforces Round 152 A~D

A #include <bits/stdc++.h> #define endl '\n' #define ios ios::sync_with_stdio(false), cin.tie(nullptr), cout.tie(nullptr) using namespace std; typedef ......
Educational Codeforces Round 152

Codeforces Round 888 (Div. 3) 题解

考场上 $7$ 题做出来 $4$ 题,最后几分钟才把 D 题调出来,但还是吃了不少罚时 # A. Escalator Conversations $O(n)$ 枚举即可,对于每个人计算需要的间隔台阶数是否在 $(0,m)$ 以内以及相差高度是否是 $k$ 的倍数 # B. Parity Sort 显 ......
题解 Codeforces Round 888 Div

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

# C. 二进制字符串复制 每次测试的时间限制2秒 每个测试的内存限制256兆字节 输入标准输入 输出标准输出 给你一个字符串s包含由...组成n个0或1。给出m次操作,让i-th 副本是字符串ti。然后,您对每个副本执行一次操作:i-th 副本,您对其子字符串进行排序[li,ri](子字符串来自原 ......
Educational Codeforces Copying Binary String

Educational Codeforces Round 76

# A. Two Rival Students 让两个人向两侧走就好了。 ```cpp #include using namespace std; void solve(){ int n , x , a , b; cin >> n >> x >> a >> b; if( a > b ) swap( ......
Educational Codeforces Round 76

Educational Codeforces Round 1

# Educational Codeforces Round 1 ## A. Tricky Sum ```cpp int fac[N],p2[N]; void init(){ fac[0]=1;p2[0]=1; for(int i=1;i0?"YES":"NO"); //puts(ans>0?"Ye ......
Educational Codeforces Round

CodeForces 1268E Happy Cactus

[洛谷传送门](https://www.luogu.com.cn/problem/CF1268E "洛谷传送门") [AtCoder 传送门](https://codeforces.com/problemset/problem/1268/E "AtCoder 传送门") 考虑一些简单的情况,比如树。 ......
CodeForces Cactus 1268E Happy 1268

【题解】Max to the Right of Min - Codeforces 1849E

**出处:** Educational Codeforces Round 152 **链接:** https://codeforces.com/problemset/problem/1849/E **题目大意:** TODO(先去看原题吧) **解题思路:** PS:这里的解题思路跟标准答案不太一样 ......
题解 Codeforces 1849E Right 1849

练习记录-cf-Educational Codeforces Round 152 (Rated for Div. 2)(A-D)

A. Morning Sandwich 题意:有面包片和火腿和芝士 问最多能组成几层三明治 题解:直接输出单考虑面包片和单考虑火腿和芝士的数量 取min #include<bits/stdc++.h> #define close std::ios::sync_with_stdio(false),ci ......

Codeforces Round 888 (Div. 3)记录

A. Escalator Conversations #include<cstdio> #include<algorithm> #include<cmath> #include<vector> #include<string.h> #include<set> #include<string> #in ......
Codeforces Round 888 Div