codeforces triangle tenzing 1842e

CodeForces CF1846G 题解

# CodeForces CF1846G 题解 - [CodeForces题目链接](https://codeforces.com/contest/1846/problem/G) - [洛谷题目链接](https://www.luogu.com.cn/problem/CF1846G) - 标准答案是 ......
题解 CodeForces 1846G 1846 CF

Codeforces Round 891 (Div. 3)

Codeforces Round 891 (Div. 3) A - Array Coloring 思路:需要两部分的奇偶相同,判断奇数的个数是否为偶数即可 #include<bits/stdc++.h> using namespace std; #define int long long //#de ......
Codeforces Round 891 Div

Codeforces 890-891的一些题目的反思

和atcoder一起出交互题是吧。 D题回复逆序对个数,对于[L,R-1]和[L,R],如果R是最大值,那么对逆序对个数无影响。这样来确认某个数是不是最大的,然后递归扩展到整个区间 这里看到逆序对,要想到归并排序、分治、递归、区间合并。。。。。 查看代码 // Problem: D. More Wr ......
Codeforces 题目 890 891

codeforces 891 (div3)857E - Power of Points

# E. 点的力量 每个测试限时2秒 每个测试限制内存为256兆字节 输入以标准格式输入 输出以标准格式输出 给定n个具有整数坐标x1,…xn的点,这些点位于数线上。对于某个整数s,我们构建段[s, x1],[s, x2],…,[s, xn]。注意,如果xi using namespace std; ......
codeforces Points Power 857E div3

Codeforces 1857D:Strong Vertices 与图论无关的出度最大统计

# [1857D.Strong Vertices](https://codeforces.com/contest/1857/problem/D "Codeforces 1855B") ## Description: - 给定两个长度均为 $n$ 的数组 $a$ 和 $b$ (编号$1$~$n$),如 ......
Codeforces Vertices Strong 1857D 1857

Codeforces Round 891 (Div. 3)

## A. Array Coloring ### 题意 给你 $n(2\le n\le50)$ 个数,你可以把每个数染成红或蓝,求是否有方案满足每个颜色都有数而且两种颜色每个颜色内所有数之和的奇偶性相同。多组数据 $(t\le1000)$。 例如:$[1,2,4,3,2,3,5,4]$ 染成 $[\ ......
Codeforces Round 891 Div

Codeforces Round 890 (Div. 2) supported by Constructor Institute A-E1

A n=50非常小 所以直接暴力枚举 枚举每次把某个数以下的全部减完 然后看一下是否上升就行 https://codeforces.com/contest/1856/submission/217275334 B题直接 贪心 前面优先放最小的 最后一个放最大的 然后如果重复了就到前面去看能不能调整一下 ......

Codeforces Round 890 (Div. 2)

## [A.Tales of a Sort](https://codeforces.com/contest/1856/problem/A) ### 题目大意 Alphen has an array of positive integers $a$ of length n. Alphen can pe ......
Codeforces Round 890 Div

Codeforces Round #890 Div.2

[link](https://codeforces.com/contest/1856) 题号:1856A~E2 ## [A](https://codeforces.com/contest/1856/problem/A) 题面: >给定一个正整数 $n$ 和一个长度为 $n$ 的序列 $a$,重复执行 ......
Codeforces Round 890 Div

Codeforces Round 890 (Div. 2) A-E1

## A. Tales of a Sort 题意:给出一个长为n的数组a,每次操作可以使得所有的数-1,最小不会小于0,问至少需要多少次操作才能使得a变得有序。 ### Solution 把数组a排序,从大到小遍历,如果当前的$a[i]$不是原来的话,那么要想让它有序,必须进行当前的$a[i]$次操 ......
Codeforces Round 890 A-E Div

Codeforces Round 890 (Div.2)

赛时没想到c是二分答案 ## C. To Become Max ### 题意 给定一个长度为$n$的数组$a$,可对$a_i$加1当$a_i\le a_{i+1}$,最多可进行$k$次这样的操作,求最多$k$次操作后数组$a$中的最大值。 ### 思路 首先找出原数组中最大的值,然后枚举1到n-1, ......
Codeforces Round 890 Div

Codeforces Round 890 (Div. 2) supported by Constructor Institute

# Preface 现在开始严格按照**双号上分法**来打CF了,大致就是每次比赛都拿两个号中分较少的那个打,这样可以保证两个号的最高分不降 然后昨天打完就后悔了,没有拿*hl666*那个号打导致没抓住难得的上分机会,本来可以打到橙名渡劫局的但分全加在*Kusanagi_Misuzu*那个号上了 不 ......

【题解】Codeforces Round 890(CF1856)

赛时过了 A-E1,rk195 可惜是 E2 傻逼了不会背包优化了,直接连普及组水平都不到了。 ## A.Tales of a Sort ### 题目描述: 给定长度为 $n$ 的序列 $a$,每次操作为对于所有 $i$ 将 $a_i$ 变为 $\max(a_i-1,0)$,询问最少多少次操作之后可 ......
题解 Codeforces Round 1856 890

CodeForces 数学类题目 做题汇总

# 写一下$3$月$28$日起开始做的题目感受: ## 1. CF1793B Fedya and Array: 普及- *1100 ### [Luogu链接](http://www.luogu.com.cn/problem/CF1793B) ### [CF链接](https://codeforces ......
CodeForces 题目 数学

Codeforces Round 690 (Div. 3)

# Codeforces Round 690 (Div. 3) https://codeforces.com/contest/1462 ## A. Favorite Sequence 按题意输出 ```CC #include using namespace std; const int N = 1e ......
Codeforces Round 690 Div

Codeforces Round 890 (Div. 2)

## Tales of a Sort >![image-20230806130431932](https://zeoy-typora.oss-cn-hangzhou.aliyuncs.com/image-20230806130431932.png) ### 题解 >* 找到最大的能够产生逆序对的数即 ......
Codeforces Round 890 Div

Codeforces Round 890 (Div. 2) supported by Constructor Institute ————C - To Become Max

关于这场div2,只能说一言难尽 C题可以二分的,赛时看到n 点击查看代码 ``` #include #define int long long using namespace std; const int N=1e6+7; int mod=1e9+7; int a[N]; int n,k; voi ......

Codeforces Round 890 (Div. 2) supported by Constructor Institute 题解

# A. Tales of a Sort 关键就是找逆序对 记一组逆序对下标为 $l,r$,则求出最大的 $a_l$ 即可 # B. Good Arrays 记要构造的 Good Array 为 $b$ 前置:$\forall 1\le i\le n,b_i=1$ 然后 $O(n)$ 扫一遍看一下有 ......

Codeforces Round 882 (Div. 2) 题解

# A. The Man who became a God 求出相邻两个元素的差值,去掉前 $m$ 个大的差值以后的差值和即为答案 # B. Hamon Odyssey 由按位与的性质可以知道,**前缀与和** 的值只会越来越小,只要和为 $0$ 的时候我们就清空按位与前缀和,增加一下次数,如果最终 ......
题解 Codeforces Round 882 Div

CodeForces 1856D More Wrong

[洛谷传送门](https://www.luogu.com.cn/problem/CF1856D "洛谷传送门") [CF 传送门](https://codeforces.com/problemset/problem/1856/D "CF 传送门") 直接求最大值不好求。我们可以采用一个交互常见的套 ......
CodeForces 1856D Wrong 1856 More

CodeForces 1856E1 PermuTree (easy version)

[洛谷传送门](https://www.luogu.com.cn/problem/CF1856E1 "洛谷传送门") [CF 传送门](https://codeforces.com/problemset/problem/1856/E1 "CF 传送门") 考虑局部贪心,假设我们现在在 $u$,我们希 ......
CodeForces PermuTree version 1856E1 1856E

CodeForces 1856E2 PermuTree (hard version)

[洛谷传送门](https://www.luogu.com.cn/problem/CF1856E2 "洛谷传送门") [CF 传送门](https://codeforces.com/problemset/problem/1856/E2 "CF 传送门") 考虑局部贪心,假设我们现在在 $u$,我们希 ......
CodeForces PermuTree version 1856E2 1856E

【题解】PermuTree (easy version) - Codeforces 1856E1

**链接:** https://codeforces.com/contest/1856/problem/E1 **题目大意:** 给定一棵以节点 $1$ 为根的树,树的大小不超过 $n(1\leq n\leq 5000)$ ,给树的节点赋各不相同的权值(可以简化为某个 $[1,n]$ 的排列),使得 ......
题解 Codeforces PermuTree version 1856E1

Codeforces Round 882 (Div. 2)

# Codeforces Round 882 (Div. 2) ## A The Man who became a God > 给定一个数组 $\{x_1,x_2,\cdots,x_n\}$ 和一个整数 $k$,记 $f(l,r)=\sum_{i=0}^{i \le r-l} |x_{l+i}-x_ ......
Codeforces Round 882 Div

Codeforces Round 885 (Div. 2) C. Vika and Price Tags

# C. Vika and Price Tags [C - Vika and Price Tags](https://codeforces.com/contest/1848/problem/C) **题意:** ​ 初始两串数列$a, b$,对于第$i$个数,令$c_i=|a_i-b_i|$,然后将 ......
Codeforces Round Price Vika Tags

Codeforces 1843D:Apple Tree

# [1843D.Apple Tree](https://codeforces.com/contest/1843/problem/D "Codeforces 1843D") ## Description: - 一棵树( $Tree$ 无环无重边 ) $n$ 个节点,根节点为1(节点编号 $1$~$n ......
Codeforces 1843D Apple 1843 Tree

Codeforces Global Round 24 D. Doremy's Pegging Game

首先我们可以假设最后一个删除的peg编号是x,那么可以发现每个编号结尾的方案数是一样的,可以只专注计算最后删1号peg的方案数,然后乘一下就好 然对于1来说,我们需要找到一个(x, y) 的组合,x和y之间允许剩pegs,但是1到x,以及y到1之间的pegs都被移除,这个状态在此时依然没有触碰blu ......
Codeforces Pegging Global Doremy Round

Educational Codeforces Round 151

# [Educational Codeforces Round 151](https://codeforces.com/contest/1845) ## T1 就是大水题~~但写了很长时间~~。 构造题。首先分类讨论: 1. 当 $x\ne1$ 时我们构造的序列长度就为 $n$ ,序列就是 $n$ ......
Educational Codeforces Round 151

Practice on Codeforces and Atcoder in August

## [Educational Codeforces Round 151 A~E](https://www.cnblogs.com/oierpyt/p/17598936.html) ## [Codeforces Round #879 Div.2](https://www.cnblogs.com/oi ......
Codeforces Practice Atcoder August and

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