addition atcoder contest prefix

AtCoder Beginner Contest 201 D - Game in Momotetsu World

# D - Game in Momotetsu World [原题链接](https://atcoder.jp/contests/abc201/tasks/abc201_d) 题意 有一个 H×W 的方格,每个方格里写着 '+' 或 '-' 有一个初始在 (1,1),(也就是左上角)的棋子, Tak ......
Momotetsu Beginner AtCoder Contest World

AtCoder Beginner Contest 317 D - President

# D - President [原题链接](https://atcoder.jp/contests/abc317/tasks/abc317_d) 题意:一共n轮,每一轮Xi > Yi (票数)时,X可以获得Zi 张席位,反之亦然;最终席位总和多的就获胜;因此要使X获胜,求Y至少要给X多少个票 思路 ......
President Beginner AtCoder Contest 317

【题解】Harbour.Space Scholarship Contest 2023-2024 D,E,F(CF1864)

## D.Matrix Cascade ### 题目描述: 有一个大小为$n \times n$的矩阵,由 0 和 1 组成。行的编号从上到下依次为$1$到$n$,列的编号从左到右依次为$1$到$n$。第$x$行与第$y$列交叉处的单元格记为$(x, y)$。 水月想把矩阵的所有元素都变成 0。她可 ......
题解 Scholarship Harbour Contest Space

AtCoder Beginner Contest 317 C - Remembering the Days

# C - Remembering the Days [原题链接](https://atcoder.jp/contests/abc317/tasks/abc317_c) 题意:每个点最多经过一次,求最长路 思路:数据范围很小,深搜每个点能到其他点的所有路,取最大 ```c++ #include us ......
Remembering Beginner AtCoder Contest Days

AtCoder Beginner Contest 317

# A - Potions ```cpp #include using namespace std; #define int long long int power(int x, int y, int p) { x %= p; int ans = 1; while (y) { if (y & 1) ......
Beginner AtCoder Contest 317

AtCoder Beginner Contest 296 C - Gap Existence

# C - Gap Existence [原题链接](https://atcoder.jp/contests/abc296/tasks/abc296_c) 题意:是否存在Ai - Aj = x 思路:排序,双指针 ```c++ #include using namespace std; const ......
Existence Beginner AtCoder Contest 296

AtCoder Beginner Contest 292 E - Transitivity

# E - Transitivity [原题链接](https://atcoder.jp/contests/abc292/tasks/abc292_e) 题意:对于一个有向图,进行加边操作,使最终任意的个点具有传递效果,即若a到b有边,b到c有边,那么a到c也要有边,问最少需要进行多少次操作,使得每 ......
Transitivity Beginner AtCoder Contest 292

AtCoder Beginner Contest 292 D - Unicyclic Components

# D - Unicyclic Components [原题链接](https://atcoder.jp/contests/abc292/tasks/abc292_d) 题意:判断一个连通块的边和点个数是否相同 思路:对它使用并查集吧 点击查看代码 ``` #include using namesp ......

codeforces div 3 contest 894 solutions

IOI失利day1了,打div 3休息一下吧 https://codeforces.com/contest/1862/ A. Gift Carpet 贪心寻找第一个v, 其他的找最早的i,k,a就好了。 应该不需要多说(?) B.Sequence Game 就是想想看当我们有4 3的时候应该怎么做? ......
codeforces solutions contest 894 div

The 2022 ICPC Asia Nanjing Regional Contest

# [The 2022 ICPC Asia Nanjing Regional Contest](https://codeforces.com/gym/104128) [出题人题解](https://sua.ac/wiki/2022-icpc-nanjing/) [TOC] vp的不是很好,就不放出来 ......
Regional Contest Nanjing 2022 ICPC

Harbour.Space Scholarship Contest 2023-2024 (Div. 1 + Div. 2)(B-D)

# Harbour.Space Scholarship Contest 2023-2024 (Div. 1 + Div. 2)(B-D) ## B Swap and Reverse 有点小妙哈哈哈 注意到 **奇数位置和偶数位置的性质** 就是说,对于swap操作,奇数位置的顺序永远可以直接排成最小 ......
Scholarship Div Harbour Contest Space

CF1839C Insert Zero and Invert Prefix 题解

首先考虑无解的情况,很明显 $a_n$ 必须为 $0$,否则没有解,因为如果最后一位为 $1$ 那么必须有 $n$ 这个数存在于 $b$ 序列中,而这种情况时不符合题意的。 然后考虑如何求解,先考虑一种比较特殊的情况,就是若干个 $1$ 后面接着一个 $0$,这里假设 $1$ 的数量有 $k$ 个, ......
题解 Insert Invert Prefix 1839C

AtCoder Regular Contest 164

# Preface 补一下好久之前的ARC,ABC的话如果没事会考虑从后往前补一下 # **A - Ternary Decomposition** 首先判掉当$k>n$时一定无解,否则可以贪心地对$n$进行三进制分解,得到最少可以拆成$k'$个数 不难发现我们总可以把其中较大的数拆成三个小的,以此来 ......
AtCoder Regular Contest 164

The 2021 ICPC Asia Shenyang Regional Contest 解题报告

[The 2021 ICPC Asia Shenyang Regional Contest](https://codeforces.com/gym/103427) solo 七题罚时 738 打到金尾了,但是这个 G 和 I 也应该是自己能做出来的。G 找了若干性质确实转化到最后一步了。但本应该搞出 ......
Shenyang Regional Contest 报告 2021

Atcoder Beginner Contest 317 解题报告

# Atcoder Beginner Contest 317 ABC316 咋没了。 暂时 A~E。 ## Hints D $\quad$可以算出每次选举需要的改票数。然后变成了一个经典问题。 E $\quad$有点 naive。不用担心暴力扫 T 掉,时间复杂度是真的。 F $\quad$F1 $ ......
Beginner Atcoder Contest 报告 317

AtCoder Beginner Contest 317 F - Nim

## 数位 DP ```cpp #include using namespace std; using ll = long long; int dp[64][10][10][10][2][2][2][2][2][2]; int main() { ll n; int b1, b2, b3; cin > ......
Beginner AtCoder Contest 317 Nim

Harbour.Space Scholarship Contest 2023-2024 (Div. 1 + Div. 2)

**A**. 给三个数 $x$ $y$ $n$ 。需要构造一个长度为 $n$ 的数组满足以下条件 1. $a_1 = x$, $a_n = y$ 。 2. $a$ 严格递增。 3. 定义 $b_i = a_{i + 1} - a_{i}$ ,$b$ 严格递减。 显然前两个条件非常宽松,定义好起始点, ......
Scholarship Div Harbour Contest Space

Harbour.Space Scholarship Contest 2023-2024 (Div. 1 + Div. 2)

# Preface 因为不清空E题调了好久才过,没时间看后面的题了遂2h下机,赛后感觉F还是可做的 这周三和周四的CF因为第二天有课可能都要开另一个小号随便打打了,毕竟有早八还打到两点钟实在是顶不住的说 # A. Increasing and Decreasing 从后往前贪心地确定每个数,最后检验 ......
Scholarship Div Harbour Contest Space

AtCoder Beginner Contest 317 G Rearranging

[洛谷传送门](https://www.luogu.com.cn/problem/AT_abc317_g "洛谷传送门") [AtCoder 传送门](https://atcoder.jp/contests/abc317/tasks/abc317_g "AtCoder 传送门") 考虑转化成匹配问题 ......
Rearranging Beginner AtCoder Contest 317

Atcoder Beginner Contest 317(F~G)

**两发罚时:** 1. D long long。 2. E bfs 不在把元素扔进队列前标记。 ## F. [Nim](https://atcoder.jp/contests/abc317/tasks/abc317_f) 考虑 $a_i$ 很小,$n$ 很大,于是不妨数位 dp。 设 $dp_{i ......
Beginner Atcoder Contest 317

The 2022 ICPC Asia Xian Regional Contest

链接 C.Clone Ranran 题意:一个人要准备一场比赛,需要出c道题,他现在可以选择两种操作:1.花费a分钟自我复制一次。(复制的自己也可以接着复制)2.花费b分钟出一道题。问最短要多少分钟可以准备c道题。 思路:枚举自我复制的次数,挨个判断就行。 #include<bits/stdc++. ......
Regional Contest 2022 ICPC Asia

The 2022 ICPC Asia Nanjing Regional Contest(A.Stop, Yesterday Please No More)

模拟边界(不是袋鼠)移动,通过二维差分维护左上角和右下角,同时注意排除重复的点 #include<bits/stdc++.h> using namespace std; #define endl "\n" typedef long long ll; const int N = 1e3 + 5; in ......
Yesterday Regional Contest Nanjing Please

The 2022 ICPC Asia Nanjing Regional Contest (G. Inscryption)

Problem - G - Codeforces 反悔贪心 #include<bits/stdc++.h> using namespace std; typedef long long ll; #define endl "\n" const int N = 1e6 + 5; inline int g ......
Inscryption Regional Contest Nanjing 2022

AtCoder Beginner Contest 215

[ABC215F] Dist Max 2 二分出 min( | xi - xj | , | yi - yj | ),双指针维护是否存在满足条件的点对(i, j),假如二分当前值是x,那么 |xi - xj| >= x &&|yi - yj| >= x #include<bits/stdc++.h> ......
Beginner AtCoder Contest 215

暑假集训D24 2023.8.22 contest I

### C.City Folding 题意:有一个由 $2^n$ 条等长线段组成的线,你可以进行 $n$ 次 **对折** ,可以从左向右对折或从右向左对折,给出初始时线段的编号 $P$ ,问如何对折 $n$ 次才能使对折后该线段恰好在从下往上数第 $H$ 层? $\operatorname{Sol ......
contest 2023 D24 24 22

2020-2021 ACM-ICPC, Asia Nanjing Regional Contest KLMEFA

# [2020-2021 ACM-ICPC, Asia Nanjing Regional Contest (XXI Open Cup, Grand Prix of Nanjing)](https://codeforces.com/gym/102992) ![image](https://img202 ......
ACM-ICPC Regional Contest Nanjing KLMEFA

AtCoder Beginner Contest 314

# A - 3.14 ```cpp #include using namespace std; #define int long long int32_t main() { ios::sync_with_stdio(0), cin.tie(0); string s = "14159265358979 ......
Beginner AtCoder Contest 314

[React Typescript] Updating the Global Namespace for an Additional Attribute

I want to add a common attribute to dom element globally: <> <div testId="123" /> <audio testId="123" /> <video testId="123" /> <a testId="123" /> <ab ......

Longest Common Prefix

> https://leetcode.cn/problems/longest-common-prefix/description/ > What's the "sort"? > A kind of overresearched cheating methods > Loosely speaking, ......
Longest Common Prefix

AtCoder Beginner Contest 315

# A - tcdr ```cpp #include using namespace std; int32_t main() { string s; cin >> s; for( auto i : s){ if( i != 'a' and i != 'e' and i != 'i' and i != ......
Beginner AtCoder Contest 315