Rated

Educational Codeforces Round 153 (Rated for Div. 2)

# Educational Codeforces Round 153 (Rated for Div. 2) 这次的div2有点难度,当时b题思路对了,但是没有写好 [A题传送门](https://codeforces.com/contest/1860/problem/A) ## A题意: 给你一个只 ......
Educational Codeforces Round Rated 153

Educational Codeforces Round 109 (Rated for Div. 2)

Educational Codeforces Round 109 (Rated for Div. 2) A - Potion-making 思路:求最小操作数即药水最简比 #include<bits/stdc++.h> using namespace std; #define int long lo ......
Educational Codeforces Round Rated 109

Educational Codeforces Round 107 (Rated for Div. 2)

Educational Codeforces Round 107 (Rated for Div. 2) A - Review Site 思路:数1和3的个数 #include<bits/stdc++.h> using namespace std; #define int long long //#d ......
Educational Codeforces Round Rated 107

某谷 Rated 比赛泛做

### P9535 「YsOI2023」连通图计数 非常好题目,爱来自湖南。 $m=n-1$ 等价于给定度数求树的个数,这是一个经典题,在「HNOI2004」树的计数有描述,即利用 Prufer 序列得到答案为 $\binom{n-2}{(d_1-1)(d_2-1)\ldots(d_n-1)}$。 ......
Rated

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

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

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

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

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 (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

练习记录-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 ......

Educational Codeforces Round 35 (Rated for Div. 2)

# Educational Codeforces Round 35 (Rated for Div. 2) https://codeforces.com/contest/911 ## A. Nearest Minimums ```CC #include using namespace std; con ......
Educational Codeforces Round Rated Div

Educational Codeforces Round 71 (Rated for Div. 2)

Educational Codeforces Round 71 (Rated for Div. 2) A - There Are Two Types Of Burgers 思路:价格高的优先取 #include<bits/stdc++.h> using namespace std; #define ......
Educational Codeforces Round Rated Div

Educational Codeforces Round 33 (Rated for Div. 2)

# Educational Codeforces Round 33 (Rated for Div. 2) https://codeforces.com/contest/893 昨日vp,今日补完F D贪心,思路值得学习; E组合数学推式子,式子不难,关键在于模型抽象 F主席树,调了老半天,关键在于要 ......
Educational Codeforces Round Rated Div

Educational Codeforces Round 137 (Rated for Div. 2)

Educational Codeforces Round 137 (Rated for Div. 2) A. Password void solve(){ int n=read(); for(int i=1;i<=n;i++)int x=read(); cout<<combination(10-n, ......
Educational Codeforces Round Rated 137

Educational Codeforces Round 151 (Rated for Div. 2)

[D. Rating System](https://codeforces.com/problemset/problem/1845/D) **题目大意** 玩家的初始积分为0,该玩家连续进行$n$场比赛,每场比赛可升高或降低玩家的积分($a_i$)。你可以设置一个$k$值,比赛过程中玩家的积分不会低 ......
Educational Codeforces Round Rated 151

Educational Codeforces Round 96 (Rated for Div. 2)E

You are given a string s. You have to reverse it — that is, the first letter should become equal to the last letter before the reversal, the second le ......
Educational Codeforces Round Rated Div

CodeTON Round 5 (Div. 1 + Div. 2, Rated, Prizes!) A-E

[比赛链接](https://codeforces.com/contest/1842) # A ## 代码 ```c++ #include using namespace std; using ll = long long; bool solve() { int n, m; cin >> n >> ......
Div CodeTON Prizes Round Rated

Educational Codeforces Round 151 (Rated for Div. 2) D. Rating System

贪心 由题可得,对于k的选择一定是单调递增的,对于前面选定的k后面选的k必须大于之前选的才会发生新的变化,因此k的选择其实是一个单调栈,由前缀和组成 我们要想最后的结果最大,则k值一定要尽可能的高,例如当选中i为k值时,如果从i后面某个原本的前缀和要大于选k之后所得到的前缀和的话,说明k不是最优的 ......
Educational Codeforces Rating System Round

Educational Codeforces Round 151 (Rated for Div. 2) C. Strong Password

题目翻译,给定t组数据,每组数据包含一个字符串s,两个长度为m的字符串l和r,要求判断是否存在一个长度为m的字符串res,满足l[i]<=res[i]<=r[i](i->0~m)且不是s的子序列 贪心 首先对于所有满足l<res<r的字符串,我们只需判断是否存在一个字符串不是子序列即可,那么我们让r ......
Educational Codeforces Password Strong Round

CodeTON Round 5 (Div. 1 + Div. 2, Rated, Prizes!)

# Preface 补题,不得不说一边晒太阳一边想题目真的纯在折磨,眼睛要被反光晃瞎了 这场ABCD和F都比较简单,E的话一个关键性质想到了但统计的时候棋差一招,G的话就是纯纯的巧妙,后面两题没看 总体来说这场质量极高,可惜和考试周冲突了没法现场打的说 (不过题目都是**丁真**题狠狠地好评) # ......
Div CodeTON Prizes Round Rated

Educational Codeforces Round 151 (Rated for Div. 2) A-D

# A ## 代码 ```c++ #include using namespace std; using ll = long long; bool solve() { int n, k, x; cin >> n >> k >> x; if (x != 1) { cout = 3) { if (k > ......
Educational Codeforces Round Rated 151

Educational Codeforces Round 151 (Rated for Div. 2)

# Preface 期末考终于结束了,终于可以回来写题了 这场是刚考完最后一门的那个晚上打的,因为太久没有写代码了所以不是很熟练而且脑子也不太灵光,只能堪堪写到D题而且手速感人 上次CF第二个号因为Rating被roll了导致从紫名掉下来了,这场就把它又打上去了,再这样后面兴许要用第三个号打了 由于 ......
Educational Codeforces Round Rated 151

CodeTON Round 5 (Div. 1 + Div. 2, Rated, Prizes!)C

# CodeTON Round 5 (Div. 1 + Div. 2, Rated, Prizes!)C ## C(dp) [C](https://codeforces.com/contest/1842/problem/C) 题目给出一个数组,我们可以在这一个数组里面找出$a_i$和$a_j$其中$ ......
Div CodeTON Prizes Round Rated