Educational

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 71

# A. There Are Two Types Of Burgers ```cpp #include using namespace std; #define int long long void solve() { int b, p, f, h, c; cin >> b >> p >> f>> ......
Educational Codeforces Round 71

【题解】Educational Codeforces Round 151(CF1845)

VP战报:1h 过了 A,B,C,D 然后被 E 罚坐 1h rank:210th 题解只有 A-E ## A.Forbidden Integer ### 题目描述: 你需要构造一个正整数序列,满足: 1. 对于 $i$,$a_i\le k$ 且 $a_i\not=x$。 2. $\sum a_i= ......
题解 Educational Codeforces Round 1845

Educational Codeforces Round 151

### AB 略 ### C(简) 将密码 $P$ 与 $S$ 进行匹配,按顺序决定 $P_i$,为了避免 $P$ 成为 $S$ 的子串,每次贪心地选择当前匹配位置最靠后的。若出现匹配不上则“YES”。 ### D 有点意思。从基础的情况入手: 设 $\{s_i\}$ 为 $\{a_i\}$ 的前缀 ......
Educational Codeforces Round 151

Educational Codeforces Round 65

# A. Telephone Number 找到第一个 8 ```cpp #include using namespace std; #define int long long const int mod = 998244353; #define mp make_pair void solve() ......
Educational Codeforces Round 65

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 28

# A. Curriculum Vitae 因为`1`之后不能出现`0`,所以求一下前缀`0`的个数和后缀`1`的个数,然后枚举第一个`1`的位置即可 ```cpp #include using namespace std; #define int long long int32_t main() ......
Educational Codeforces Round 28

Educational Codeforces Round 23

# A. Treasure Hunt ```cpp #include using namespace std; int read() { int x = 0, f = 1, ch = getchar(); while ((ch '9') && ch != '-') ch = getchar(); i ......
Educational Codeforces Round 23

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

Educational Codeforces Round 29

# Educational Codeforces Round 29 https://codeforces.com/contest/863 复健训练 太久没练直接变身傻逼(难道原来就不是吗,笑) ## A. Quasi-palindrome 直接去除后缀0即可(WA了两发评价为弱智) ```CC #i ......
Educational Codeforces Round 29

Educational Codeforces Round 22

# A. The Contest 想一想就知道,提交的时间无所谓,所以我们选择全部做完后的第一个时间间隔提交即可 ```cpp #include using namespace std; #define int long long int read() { int x = 0, f = 1, ch ......
Educational Codeforces Round 22

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

Educational Codeforces Round 151 (Div. 2) C

卡c题了,用双指针做的,赛后发现不用双指针也行。 ## C. Strong Password ### 题意 给定1个字符串$s$,和两个长度相同的字符串$l,r$,字符串的所有元素都在0~9之间。求是否存在一串字符,其中每个数字都在对应位置$l,r$的数字之间,且该字符串不能是$s$的子序列。 ## ......
Educational Codeforces Round 151 Div

Educational Codeforces Round 150 A~D

c题好难。 ## A. Game with Board [Problem - A - Codeforces](https://codeforces.com/contest/1841/problem/A) ### 题意 给定若干个数字1,Alice和Bob每回合合并两个相同的数字,Alice先手。如果 ......
Educational Codeforces Round 150

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

Educational Codeforces Round 151 [div.2 #A-C] 赛后总结(contest/1845)

### [link](https://codeforces.com/contest/1845 "Educational Codeforces Round 151") $\textcolor{52C41A}{A}-\textcolor{FADB14}{B}-\textcolor{FADB14}{C}- ......
Educational Codeforces contest Round 1845

Educational Codeforces Round 151 F. Swimmers in the Pool

### 一.前言 本来打算打打这个比赛玩玩,结果同学找我打游戏王去了,就没打现场(逃) 因为是一道不错的数学题,来写写补题的题解 这里点名批评 @[HOLIC](https://codeforces.com/profile/HOLlC) 喂给我的假题意,让我查错大半天,最后发现题意错了还重新推了好多 ......
Educational Codeforces Swimmers Round Pool

Educational Codeforces Round 151 (Rated for Div. 2)(C,D)

# Educational Codeforces Round 151 (Rated for Div. 2)(C,D) ## C(dp,子序列自动机) [C](https://codeforces.com/contest/1845/problem/C) 题目大意就就是给你一个字符串$s$,还给出两个边 ......
Educational Codeforces Round Rated 151

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

A. Forbidden Integer 模拟: void solve(){ int n,k,x; cin>>n>>k>>x; if(x!=1){ cout<<"YES\n"<<n<<"\n"; for(int i=1;i<=n;i++) cout<<"1"<<" \n"[i==n]; return ......
Educational Codeforces Round Rated 151

Educational Codeforces Round 151 (Rated for Div

## C. Strong Password >给定一个字符串$s$,一个密码的长度$m$,下界字符串$l$和上界字符串$r$,上下界字符串长度均为$m$,且字符只在0~9范围内,上界字符串的第 $i$ 位非严格大于下界字符串的第 $i$ 位,密码的第 $i$ 位需要位于 $[l_i, r_i]$ 内 ......
Educational Codeforces Round Rated 151

Educational Codeforces Round 150 (Rated for Div. 2) A-E

[比赛链接](https://codeforces.com/contest/1841) # A ## 代码 ```c++ #include using namespace std; using ll = long long; bool solve() { int n; cin >> n; if (n ......
Educational Codeforces Round Rated 150

题解:【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 ......

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

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

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