educational codeforces together round

Codeforces 1835F - Good Graph

good problem,bad round。 判断 YES 还是 NO 很trivial,就直接跑最大匹配看看是不是 $n$ 即可。 如果是 NO,那么考虑 Hall 定理的证明过程构造即可。具体方法就是找到左部任意一非匹配点,在残量网络上 BFS 可以到达的点,那所有可以到达的左部点形成的集合就 ......
Codeforces 1835F Graph 1835 Good

Codeforces 1835E - Old Mobile

首先先观察到一个非常浅显的性质:就是一个位置在序列中不是第一次出现,那么到这个位置的时候打出这个字符需要恰好一次按键,这是因为我们肯定在打出第一次出现这个字符的位置的时候已经知道哪个键对应这个字符了,到那个位置的时候直接敲一下就 ok 了。 也就是我们只用关心这个序列中出现了多少种不同的数,设为 $ ......
Codeforces Mobile 1835E 1835 Old

Codeforces Round 878 (Div. 3) D. Wooden Toy Festival

题目翻译:给定一个序列,你可以把序列分为任意的三组不要求顺序,对于每一组序列给出一个数字作为标准,求出序列中和该数字的差绝对值的最大值,现在要求你选顶三个数字使得三个序列的差最大值的最大值最小 解题思路:二分,要想方差最小,就让每一组的极差都最小,即最大值减最小值最小 #include <iostr ......
Codeforces Festival Wooden Round 878

Codeforces Round 881 (Div. 3) F2. Omsk Metro (hard version) (线段树 )

[传送门](https://codeforces.com/contest/1843/problem/F2) 大致题意: ** 动态给定一颗树,树上每个结点的权值一定为1或者-1。最开始有1号点,权值为1。** ** 输入n表示有n个操作,当第一个符号为+ a b表示添加结点操作,编号依次递增。a表示 ......
线段 Codeforces version Round Metro

洛谷 P8264 [Ynoi Easy Round 2020] TEST_100

[题目 Link](https://www.luogu.com.cn/problem/P8264) 我们不妨来考虑所有询问都是 $l=1,r=n$ 的情形,这种情况下需要对每个值处理出他经过一系列变换后变成了什么数。 考虑用 $\text{solve}(p,l,r)$ 表示我们现在要计算 $x\in ......
P8264 Round 8264 2020 Easy

Codeforces Round 881 (Div. 3)

## [A - Sasha and Array Coloring (CF1843 A)](https://codeforces.com/contest/1843/problem/A) ### 题目大意 给定一个数组,给每个元素涂色。求最大的代价。 代价为每个颜色的代价和。 每个颜色的代价为涂了该颜色 ......
Codeforces Round 881 Div

练习记录-cf-Codeforces Round 881 (Div. 3)A-F1

E是补的 太蠢了没想到 期末考完的复健 A. Sasha and Array Coloring 题意:可以给不同数字涂上很多颜色,每个颜色的贡献是同一个颜色内的数字最大值和最小值的差 思路:排序一遍,取头和尾的差 #include<bits/stdc++.h> #define close std:: ......
cf-Codeforces Codeforces Round 881 A-F

Codeforces Round 881 (Div. 3)

Codeforces Round 881 (Div. 3) A: void solve(){ int n; cin>>n; for(int i=1;i<=n;i++){ cin>>a[i]; } sort(a+1,a+1+n); int ans=0; int l=1; int r=n; for(in ......
Codeforces Round 881 Div

CodeForces 合集

# 1838E. Count Supersequences https://codeforces.com/contest/1838/problem/E ## 题意 给定 $n, m, k$,一个长度为 $n$ 的序列 $a = (a_1, a_2, \dots, a_n)$,满足 $1 \leq a ......
CodeForces

Codeforces Round 880 (Div. 2) C. k-th equality

看好久题目了,题目大意是给定三个位数A,B,C和一个k,要求求所有满足要求的a+b=c等式中的第k个等式 等式按字典序由小到大枚举,例如1+9=10和2+6=8中1+9=10比2+6=8小 思路我们首先求出a,b,c的取值范围,然后先确定a,对于每一个确定的a都有一个确定的b和c区间与之对应,并且a ......
Codeforces equality Round k-th 880

Codeforces Round 879 (Div. 2) 题解

寄!大!了! Rating -= 124. ![image](https://img2023.cnblogs.com/blog/3143679/202306/3143679-20230619222246244-5109748.png) (恼) https://codeforces.com/conte ......
题解 Codeforces Round 879 Div

Codeforces 1834 / Codeforces Round #879 (Div. 2)

[TOC] ### Contest Link [Codeforces Round #879 (Div. 2)](https://codeforces.com/contest/1834) ### Problem B [Maximum Strength](https://codeforces.com/c ......
Codeforces Round 1834 879 Div

Codeforces Round 880 (Div. 2) B. Astrophysicists

昨天晚上卡B题了,掉大分,qwq 现在回想起来昨天没反应过来 题目要求为公司节省最多的钱 我们可以发现如果n个人,每个人的分的钱都小于g/2且者n个人分的钱加起来恰好为k*g的话则公司一分钱都不用花 第一种情况 假设每个人分的钱都为h则最理想的情况为h*n>=k*g且h<g/2,即h=g/2-1 如 ......
Astrophysicists Codeforces Round 880 Div

题解:【AT Educational DP Contest-O】 Matching

[题目链接](https://www.luogu.com.cn/problem/AT_dp_o) 来点位运算优化,目前也是拿下了洛谷最优解,比第二名快一倍: ```cpp #include #define int long long #define btp(x) __builtin_popcount ......

Codeforces Round 879 (Div

# [Codeforces Round 879 (Div. 2)](https://codeforces.com/contest/1834) A-D题解 第一次写题解,请见谅O3O a题代码是完整的,后面的只显示主要内容的代码 ## A. Unit Array 题目解释 他会给你一个只包含1或者-1 ......
Codeforces Round 879 Div

Codeforces1 #879 div.2

第一次参加codeforces比赛,只能做出来俩题,第三个题思路也就一半一半,估计是想不出来的那种,赛后问了下带佬,把我思路添加了点,最终还是A了 争取稳过第三题! //A //统计1,-1出现的次数,然后如果-1是奇数,让他变成偶数,次数+1 //因为总乘积要是正1,然后再变-1为1,直到>=0为 ......
Codeforces1 Codeforces 879 div

Codeforces Round 880 (Div. 2) 题解 A - C

## 写在前面 感觉题目是一坨。 A愣了一会,BC同开然后半天读不懂题。写出来发现毛算法都没有,div1那边更是大寄。DEF三题过题数个位数根本看都看不来。总结为很烂的一场。 ## [A](https://codeforces.com/contest/1836/problem/A). Destroy ......
题解 Codeforces Round 880 Div

[ABC241G] Round Robin

# [ABC241G] Round Robin ## 题意 $ N $ 名玩家进行循环赛。总共进行 $ \frac{N(N-1)}{2} $ 场比赛,比赛必然分出胜负,不存在平局,一场比赛中胜者获得 $ 1 $ 分。 当前进行了 $ M $ 场比赛,其中第 $ i $ 场 $ W_i $ 打败了 $ ......
Round Robin 241G ABC 241

Educational Codeforces Round 150 (Rated for Div. 2) C. Ranom Numbers

#include <iostream> #include <string> #include <cstring> #include <algorithm> #include <cmath> using namespace std; const int N=2e5+10; typedef long l ......
Educational Codeforces Numbers Round Rated

Educational Codeforces Round 150 (Rated for Div. 2) B. Keep it Beautiful

#include <iostream> #include <cstring> using namespace std; const int N=2e5+10; int a[N],res[N]; int t; int main(){ cin>>t; while(t--){ int n; cin>>n; ......
Educational Codeforces Beautiful Round Rated

CodeForces 1841C Ranom Numbers

[洛谷传送门](https://www.luogu.com.cn/problem/CF1841C "洛谷传送门") [CF 传送门](https://codeforces.com/problemset/problem/1841/C "CF 传送门") 先反转 $s$ 串,然后考虑 dp,设 $f_{ ......
CodeForces Numbers 1841C Ranom 1841

Educational Codeforces Round 150 (Rated for Div. 2)题解(A~D)

比赛地址 A. Game with Board 题意: 给出一个包含n个1的数组,Alice和Bob轮流操作(Alice先手),每次操作可以将若干个(最少为两个)不同的元素相加,组成一个新的元素插入数组中,同时删去被操作的元素。当轮到某名玩家时无法再进行操作,则该玩家获胜。 思路: 容易想到,当n= ......
题解 Educational Codeforces Round Rated

Codeforces Round 855 (Div. 3)

`https://codeforces.com/contest/1800` **E. Unforgivable Curse** 题意:输入两个字符串s,t , 每次修改可以交换相距k或k+1位置的字母,能否将将s修改为t。 方法:首先,两个字符串必须由相同元素,且每种元素的个数相等。其次,元素可以先 ......
Codeforces Round 855 Div

CodeForces 1839E Decreasing Game

[洛谷传送门](https://www.luogu.com.cn/problem/CF1839E "洛谷传送门") [CF 传送门](https://codeforces.com/problemset/problem/1839/E "CF 传送门") 不会,不知道该如何评价。确实是自己的问题。 这种 ......
CodeForces Decreasing 1839E 1839 Game

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

https://codeforces.com/contest/1841 https://codeforces.com/contest/1841/problems # D. Pairs of Segments https://codeforces.com/contest/1841/problem/D ......
题解 Educational Codeforces Round Rated

Codeforces Round 877 (Div.2) 题解 A - D

## [A](https://codeforces.com/contest/1838/problem/A). Blackboard List ### 题目大意 起初黑板上有两个数,现在不断选取两个数作出他们俩差的绝对值并写在黑板上,如此往复直到黑板上有 $n$ 个数。现在给定这 $n$ 个数,问起初 ......
题解 Codeforces Round 877 Div

Codeforces Round 877 (Div. 2)

# Preface 补题 这场补题的时候直接成腐乳了,A题挂两发,B题挂两发,C题挂一发是真的抽象 虽然D是个套路题看一眼就秒了,但如果真的比赛时候打真要罚时爆炸了的说 后面的EF还是做不来啊岂可修,不过都很有启发性让人感觉神清气爽,不像傻逼蓝桥杯花钱买罪受 # A. Blackboard List ......
Codeforces Round 877 Div

Codeforces Round 876 Div2 A-D题解

# Codeforces Round 876 Div2 A-D题解 # A.The Good Array 这个题就是问你对于 $i \leq n$,要求前面后面至少 $ceil(\frac{i}{k})$ 个 1 那我们就贪心的每k个放一个1,或者直接用数学算一下就好了 AC 代码 ```cpp # ......
题解 Codeforces Round Div2 876

[Codeforces Round 876 (Div. 2)][Codeforces 1839D. Ball Sorting]

题目链接:[D - Ball Sorting](https://codeforces.com/contest/1839/problem/D) 题目大意:需要对一个排列按照指定操作进行排序。操作一:在数字间插入一个特殊点,可执行不超过 $k$ 次;操作二:将在特殊点旁的数移动到任意位置。所有操作结束后 ......
Codeforces Sorting Round 1839 Ball

Codeforces 1188D Make Equal

设最终所有数变为的值为 $u$,$\operatorname{bitcount}(x)$ 为 $x$ 二进制上为 $1$ 的位数,由题可得答案即为 $\sum\limits_{i = 1}^n \operatorname{bitcount}(u - a_i)$。 此时让 $a_i$ 从小到大排序,答 ......
Codeforces 1188D Equal 1188 Make