codeforces triangle tenzing 1842e

Codeforces Round 887 (Div. 2)

## C. Ntarsis' Set >​ ![image-20230724121346402](https://zeoy-typora.oss-cn-hangzhou.aliyuncs.com/image-20230724121346402.png) > >($1 \leq n,k \leq 2 ......
Codeforces Round 887 Div

Codeforces Round 887 (Div 2) C. Ntarsis' Set

Ntarsis' Set 题意是给你n个数,每次按照顺序删除位于a[i]位置的这n个数,问k次后最小的是多少 参考这位大佬的题解Codeforces Round 887 (Div 2)A~C - 知乎 (zhihu.com) 结合一个官方题解,进行一次操作后,由于前面删掉i个数,a[i]到a[i+1 ......
Codeforces Ntarsis Round 887 Div

【题解】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

Codeforces Round 886 (Div. 4) 题解 A - H

## [A](https://codeforces.com/contest/1850/problem/A). To My Critics ### 题目大意 给定三个数,你可以挑俩数加起来,问这仨数有没有可能加起来大于等于 $10$ . ### 解题思路 我们找其中最大的两个数相加与 $10$ 比较即 ......
题解 Codeforces Round 886 Div

Codeforces Round 886 (Div. 4) 全题题解

我关注的人中正式参与**比赛排名公示**: | # | Who | = | Penalty | * | [A](https://codeforces.com/contest/1850/problem/A) | [B](https://codeforces.com/contest/1850/probl ......
题解 Codeforces Round 886 Div

CodeForces 1776C Library game

[洛谷传送门](https://www.luogu.com.cn/problem/CF1776C "洛谷传送门") [CF 传送门](https://codeforces.com/problemset/problem/1776/C "CF 传送门") orz p_b_p_b。 下文令 $a_i$ 为 ......
CodeForces Library 1776C 1776 game

Codeforces Round 886 (Div. 4)记录

A - To My Critics 代码: #include<cstdio> #include<algorithm> #include<cmath> #include<vector> #include<string.h> #include<set> #include<string> #include ......
Codeforces Round 886 Div

Codeforces Round 885 (Div. 2) A - C

# A. Vika and Her Friends [Problem - A - Codeforces](https://codeforces.com/contest/1848/problem/A) **题意:** ​ 在$n*m$的范围内,$a$和她的朋友在追逐游戏,每秒$a$和朋友必须从当前位置 ......
Codeforces Round 885 Div

Codeforces Round 886 (Div. 4)(A-H)

# A-To My Critics 读入 a,b,c 如果三个里较大的两个的和大于等于 10 输出 YES,不然输出 NO ``` #include using namespace std; void solve() { int a, b, c; cin >> a >> b >> c; cout = ......
Codeforces Round 886 A-H Div

Codeforces Round 886 (Div. 4)补题

# [Codeforces Round 886 (Div. 4)](https://codeforces.com/contest/1850) ## A~D: ```c++ //A: bool solve(){ cin>>a[1]>>a[2]>>a[3]; sort(a+1,a+4); return ......
Codeforces Round 886 Div

Codeforces Round 886 (Div. 4)

## F. We Were Both Children >![image-20230722103513062](https://zeoy-typora.oss-cn-hangzhou.aliyuncs.com/image-20230722103513062.png) ### 题解:约数 >* 我们先 ......
Codeforces Round 886 Div

Codeforces Round 886 (Div. 4)

Codeforces Round 886 (Div. 4) A - To My Critics 思路:最大的两个数的和大于等于10则YES #include<bits/stdc++.h> using namespace std; #define int long long typedef pair< ......
Codeforces Round 886 Div

「解题报告」Codeforces Round 886 (Div. 4)

比赛地址:[Dashboard - Codeforces Round 886 (Div. 4) - Codeforces](https://codeforces.com/contest/1850) 由于时间太晚了,因此并没有参加比赛,题目都是后来补做的。 ## A. To My Critics [P ......
Codeforces 报告 Round 886 Div

Codeforces 1456E - XOR-ranges

考虑一个 $L\le x\le R$ 的数 $x$,必然是一段前缀贴着 $L$ 或者 $R$,然后下一位脱离了 $L$ 和 $R$ 的限制,后面随便乱填。 注意到一个性质,对于某一位 $d$,考虑这一位上没有限制的那些位置,最优方案肯定是令其等于其左边(或者右边)第一个有限制的数的第 $d$ 位上的 ......
Codeforces XOR-ranges ranges 1456E 1456

Codeforces Round 886 (Div. 4)

# A. To My Critics ```cpp #include using namespace std; #define int long long void solve(){ vector a(3); for( auto & i : a ) cin >> i; sort( a.begin() ......
Codeforces Round 886 Div

Codeforces 1329E - Dreamoon Loves AA

思考下什么样的 $l,r$ 是合法的:显然对于一组长度为 $len$ 的空隙,要使得相邻两个 A 之间的距离在 $[l,r]$ 中,你新插入的 A 的个数应该位于 $[\lceil\dfrac{len}{r}\rceil-1,\lfloor\dfrac{len}{l}\rfloor-1]$ 中。因此 ......
Codeforces Dreamoon 1329E Loves 1329

Codeforces 1830E - Bully Sort

这种题肯定首先要**寻找不变量**。 显然后面排好序的后缀不会被改变。因此从整体上来看我们的流程肯定是,如果当前 $p_n=n$,就令 $n$ 减一,否则你一步换的 $i$ 肯定满足 $p_i=n$。而显然 $\min\limits_{j=i}^np_j\le i$,因此我们考察 $\sum|i-p ......
Codeforces 1830E Bully 1830 Sort

Codeforces 794G - Replace All

一个比较垃圾的做法,卡着时限过了这道题。 首先大胆猜个结论:要么 $|s|=|t|$,此时 $A,B$ 任取,要么存在字符串 $c$ 和整数 $x,y$ 使得 $A=c^x,B=c^y$,其中 $c^x$ 表示 $x$ 个 $c$ 拼接得到的结果。证明的话感觉还挺复杂的,可能要 border 引理之 ......
Codeforces Replace 794G 794 All

Codeforces 1662J - Training Camp

这种数据范围和题目特点一眼网络流。 对于一种选法,我们考虑建立两个黑白矩阵,如果一个点 $(i,j)$ 被选,我们就将第 $i$ 行中 $a_{i,k}\le a_{i,j}$ 的 $(i,k)$ 在第一张网格图中染成黑色,将第 $j$ 列中 $a_{k,j}\le a_{i,j}$ 的点 $(k, ......
Codeforces Training 1662J 1662 Camp

Codeforces Round 501 (Div. 3)

Codeforces Round 501 (Div. 3) A - Points in Segments 思路:记录每个区间 #include<bits/stdc++.h> using namespace std; #define int long long //#define int __int1 ......
Codeforces Round 501 Div

Codeforces 1470F - Strange Covering

一年前模拟赛的题,时隔恰好一年零一天又考了一遍还是不会做。 对两个矩形的位置分情况: 1. 相离,此时必然存在一条与 $x$ 轴或 $y$ 轴平行的分界线,满足一个矩形在左边(下面),另一个矩形在右边(上面)。这部分显然可以 $O(n)$ 地处理。 2. 相交成十字形。这一类我的处理比较烦:考虑预处 ......
Codeforces Covering Strange 1470F 1470

Codeforces 856F - To Play or not to Play

首先,DP 肯定是逃不掉的,因为直接贪心其实不好判断在两个人都可以上线的时间段究竟是哪个人上线,需要通过后面的情况来做出判断,但是这题值域比较大直接维护 DP 值肯定不行,因此考虑先设计一个与值域有关的 DP 然后优化。 将时间区间离散化,然后依次考虑每个时间区间。一个很自然的想法是设 $dp_{i ......
Play Codeforces 856F 856 not

Codeforces Round div.2 C

Smiling & Weeping 我对姑娘的喜欢,何止钟意二字 题目链接:Problem - C - Codeforces 自我分析:我感觉这是一道很有意义的题目,可以帮我们更好的理解二进制的本质 思路:首先先了解一下题目,我们是求由第i个数到末尾的异或和(异或:相同为0,不同为1),那么我们可以 ......
Codeforces Round div

Codeforces 1787I - Treasure Hunt

注意到这什么 $s>q$ 或 $t\le q$ 的限制条件是没有用的,因为如果 $s\le q>1;solve2(l,mid);solve2(mid+1,r); static ll mn[MAXN+5],mx[MAXN+5],f[MAXN+5],g[MAXN+5]; mn[mid+1]=mx[mid ......
Codeforces Treasure 1787I 1787 Hunt

Codeforces Round 882 div.2 B

Smiling & Weeping 玫瑰花你拿才好看,风景要和你看才浪漫--<-<-<@ B. Hamon Odyssey time limit per test 1 second memory limit per test 256 megabytes input standard input ou ......
Codeforces Round 882 div

Codeforces 1696G - Fishingprince Plays With Array Again

初读题目可以发现一些性质: - 每次操作会使整个序列的和减少至多 $X+Y$,因此 $ans\ge\dfrac{\sum a_i}{X+Y}$。 - 对于两个不相邻位置 $a_i,a_j(|i-j|>1)$,每次操作最多使它们的和减少 $\max(X,Y)$。 然后你发现两个限制可以结合在一起使用, ......
Fishingprince Codeforces 1696G Array Again

Codeforces 1446F - Line Distance

[感觉这种类似于让你找第 $k$ 大距离的计算几何题其实都挺套路的。](https://www.cnblogs.com/tzcwk/p/Codeforces-607E.html) 二分一个答案 $t$,然后思考一下什么样的点对满足原点到它们的连线的距离 $\le t$。以原点为圆心 $t$ 为半径画 ......
Codeforces Distance 1446F 1446 Line

Codeforces 1621H - Trains and Airplanes

这能 3500? 对于一组在 $u$ 上的询问,考虑每种线路 $x$,假设 $1\to u$ 路径上线路 $x$ 的长度为 $len$,那么不难发现收罚款的次数只有两种可能:$\lfloor\dfrac{len}{T}\rfloor$ 或者 $\lfloor\dfrac{len}{T}\rfloor ......
Codeforces Airplanes Trains 1621H 1621

Codeforces 1785E - Infinite Game

很没感觉的一道题。 首先特判掉 $n\le 2$。 在 $s$ 无穷拼接的过程中,我们考虑一个周期一个周期地匹配,由于每局比赛的长度是 $2$ 或者 $3$,因此每个周期开始的时候,把上个周期剩下的零头匹配完之后起始匹配位置只可能是 $0$ 或 $1$ 或 $2$,并且对于一个起始匹配位置 $i(0 ......
Codeforces Infinite 1785E 1785 Game

CF1842G Tenzing and Random Operations 思考

借鉴了一下 namelessgugugu 的想法,妙妙题。 [link](https://www.luogu.com.cn/blog/namelessgugugu/solution-cf1842g) 这个神奇工具的构造确实挺妙的,非常好的思维题,在此记录一下 ### 代码 ```cpp #inclu ......
Operations Tenzing Random 1842G 1842