elevator p9579 round cfz

Codeforces Round 884 (Div. 1 + Div. 2) D. Row Major

题目要求输出一个字符串,使用最少的字符种类,使得任意所有的i行j列中任意相邻的字符不同 首先相邻的肯定必须不同,i-1和i一定不同,其次观察可得,1和2不同,如果n%3==0的话,则1和2和3都不同,如此反复,直到n%i!=0,则i可以取和1相同然后,得到连续的最长长度为1~i #include < ......
Codeforces Div Round Major 884

Codeforces Round 884 (Div. 1 + Div. 2) C. Particles

思路:DP f[i]表示的是i可以到达的最大值 从左往右遍历,对于i来说最大值有三种情况 1:i本身就是最大 2:去掉i-1,i和i-2合并,这里的i-2是指和前面合并完达到最大的值 3:i前面某一个数字j最大,其中j~i之间恰好为奇数个,可以合并抵消掉,例如100 -1 -4 -1 100 #in ......
Codeforces Div Particles Round 884

Codeforces Round 884 (Div. 1 + Div. 2) B. Permutations & Primes

题目大意求出一个n的排列,使得对于所有的长度的子区间其中不包含在该子区间中最小正整数为质数,这样的区间数最多 对于任意长度的区间,如果1不包含,则这样的区间一定是bad的,因此我们想要1尽可能在区间中则1放中间,此外,2和3是除1外的最小正整数也是质数,如果2和3不包含在区间则该区间一定是good的 ......
Permutations Codeforces Div Primes Round

Codeforces Round 871 (Div. 4) ABCDEF

> 很久没写题目了,划点水题 ###A. Love Story ``` #include using namespace std; typedef long long LL; typedef pair PII; const LL MAXN = 1e18; const LL N = 1e6, M = ......
Codeforces ABCDEF Round 871 Div

「解题报告」Codeforces Round #884 (Div. 1 + Div. 2) Editorial

比赛地址:[Dashboard - Codeforces Round 884 (Div. 1 + Div. 2) - Codeforces](https://codeforces.com/contest/1844) 个人评价:这场是**构造**专场! ## A. Subtraction Game [ ......
Codeforces Div Editorial 报告 Round

Codeforces Round #771 (Div. 2) A-E

# A ## 代码 ```c++ #include using namespace std; using ll = long long; int p[507]; bool solve() { int n; cin >> n; for (int i = 1;i > p[i]; int pos1 = 0 ......
Codeforces Round 771 A-E Div

SMU Summer 2023 Contest Round 2

# [SMU Summer 2023 Contest Round 2](https://codeforces.com/group/L9GOcnr1dm/contest/450889) ## [A. Treasure Hunt](https://codeforces.com/group/L9GOcnr ......
Contest Summer Round 2023 SMU

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

Codeforces Round 883 (Div. 3)

# Codeforces Round 883 (Div. 3) 题目链接:[Codeforces Round 883 (Div. 3)](https://codeforces.com/contest/1846 "Codeforces Round 883 (Div. 3)") ## A. Rudolp ......
Codeforces Round 883 Div

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

SMU Summer 2023 Contest Round 1

# [SMU Summer 2023 Contest Round 1](https://codeforces.com/group/L9GOcnr1dm/contest/450888) ## [A. The Contest](https://codeforces.com/group/L9GOcnr1d ......
Contest Summer Round 2023 SMU

Educational Codeforces Round 29

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

牛客周赛 Round 2 A~D

A #include <iostream> #include <cstring> #include <string> #include <algorithm> #include <cmath> #include <set> #include <utility> #include <vector> # ......
Round

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

Codeforces Round 882 题解

## [Codeforces Round 882 (Div. 2)](https://codeforces.com/contest/1847 "Codeforces Round 882 (Div. 2)") ## [A. The Man who became a God](https://codef ......
题解 Codeforces Round 882

Codeforces Round #883 (Div. 3) A-G

[比赛链接](https://codeforces.com/contest/1846) # A ## 代码 ```c++ #include using namespace std; using ll = long long; bool solve() { int n; cin >> n; int c ......
Codeforces Round 883 A-G Div

Codeforces Round 771 (Div.2) C

刚开始c题用dp做的,一直没做出来 ## B. Odd Swap Sort [Problem - B - Codeforces](https://codeforces.com/contest/1638/problem/B) ### 题意 给定一个序列$a$,如果$a_i$与$a_{i+1}$的和为奇 ......
Codeforces Round 771 Div

Codeforces Global Round 14

这场貌似很典很好啊。 ### A. Phoenix and Gold > 给定一个长度为 $ n $ 的数组 $ w $ 和一个数 $ x $,数组中的数**各不相同**,要求**重新排列**这个数组,使得对于每一个 $ i $ $ (1 \le i \le n) $,都有 $ \sum\limit ......
Codeforces Global Round 14

round 函数

# round 函数 要求**四舍五入**的情况,用round函数就很方便。 ## 一、用法 ### 1.基本用法 对于小数而言,round()函数**仅仅保留到整数位**,仅对小数点后一位进行四舍五入。 比如:round(1.5) = 2.000000,round(1.57) = 2.000000 ......
函数 round

内置函数round

1 ''' 2 内置函数round对参数进行四舍五入/ 3 语法: round(number, ndigits) 4 其中,number是要进行四舍五入的数字,而ndigits是可选参数,表示保留小数的位数,默认为0。 5 number:要进行四舍五入的数字。 6 ndigits:保留小数的位数。如 ......
函数 round

Codeforces Round 862 (div.2) C

vp时c题用自已的方法过了,赛后补下正解 ## C.Place for a Selfie [Problem - C - Codeforces](https://codeforces.com/contest/1805/problem/C) ### 题意 给定一些抛物线和过原点的直线,对于每个抛物线,是 ......
Codeforces Round 862 div

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

[比赛地址](https://codeforces.com/contest/1847) ## A. The Man who became a God 题意:定义f(l,r)为区间[l,r]所有相邻数的差的绝对值的和,大小为1的区间的f为0,给出一个数组a,问把他分成m个区间,这m个区间的f值的和最小 ......
题解 Codeforces Round 882 A-D

Codeforces Round 883 (Div. 3)

Codeforces Round 883 (Div. 3) A. Rudolph and Cut the Rope: 题意: 有一个糖果由n个绳子悬挂,告诉每一个绳子位于的高度和宽度,问至少间断几根才可以让candy回到groud。 思路: 统计有几个宽度小于高度的绳子即可 void solve() ......
Codeforces Round 883 Div

Codeforces Round 875 (Div. 2)(D)

# Codeforces Round 875 (Div. 2)(D) ## D (思维) 这个题意是给你两个数组,$a$和$b$,我们需要找到这样的二元组$(i,j)$满足$a_i\times a_j=b_i+b_j$,问一共有多少组满足以上条件的二元组 题目还告诉我们数组里面的数字都是不大于$n$ ......
Codeforces Round 875 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

Codeforces Round 882 (Div. 2)

# Preface 这场现场打的,顶着第二天一早起来军训硬打到一点 这场题目都是JOJO确实好评,但刚开始的评测姬爆让人很难顶啊,因为这个B题挂了一发没法第一时间改导致这场罚时裂开了 这场写完D还有快50min,然后看一眼榜E出的人很少但是F好多人过 然后就去想F,由于军训生物钟的缘故当时好困好困, ......
Codeforces Round 882 Div

Codeforces Round 882 (Div. 2) C. Vampiric Powers, anyone?

由题目观察可得,a[m+1]=a[i]^...a[m],,结合异或的性质a^b^a=b,可得如果在末尾添加一个a[m+1],a[m+1]会和末尾几个抵消掉,求得i~k这一段的异或和,k<m,因此通过该操作实际上我就可以求得所有长度连续区间的异或和,求其最大值,n=1e5+10,如果暴力求解肯定会超时 ......
Codeforces Vampiric Powers anyone Round

Codeforces Round 882 (Div. 2) A-D

AThe Man who became a God 假设sum为 omiga abs(a[i] - a[i -1]) 1 <= i <= n 只有设置断点的时候,假设设置在t和t-1之间 the value才会减少abs(a[t]-a[t-1]) 所以把差距最大的几个地方分段就行了 #include ......
Codeforces Round 882 A-D Div

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

Codeforces Round 882 (Div. 2) - C

# [C. Vampiric Powers, anyone?](https://codeforces.com/contest/1847/problem/C) **题意:** 给你n个数,你可以进行任意次操作,每次操作你可以从数组最后往前选择任意个连续的数并将其异或和的结果放置在数组末尾,问你操作过程 ......
Codeforces Round 882 Div