balanced regional contest array

Atcoder Regular Contest 156 E - Non-Adjacent Matching

感觉可能没有银牌的难度(?),感觉有的铜牌题比这要难一些。 先猜一下什么样的 $\{x_i\}$ 是合法的。结论是 $\forall i,x_i+x_{i\bmod n+1}\le S-(x_i+x_{i\bmod n+1})$,且 $S$ 是偶数。必要性显然。充分性就考虑如果不存在任何一个 $i$ ......

ABC222D-Between Two Arrays(前缀和优化dp)

题意:给定两个递增数列A和B,构造一个ai <= ci <= bi 的递增数列C,询问满足条件的C的个数。 普通dp会超时,用前缀和优化 n=int(input()) a=list(map(int,input().split())) b=list(map(int,input().split())) ......
前缀 D-Between Between Arrays ABC

AtCoder Regular Contest 164 A~C

A题都没做出来(被自已菜晕 ## A. **Ternary Decomposition** [A - Ternary Decomposition (atcoder.jp)](https://atcoder.jp/contests/arc164/tasks/arc164_a) ### 题意 给定一个正 ......
AtCoder Regular Contest 164

2022-2023 Winter Petrozavodsk Camp, Day 4: KAIST+KOI Contest 部分题解(持续更新)

[比赛链接](https://codeforces.com/gym/104345) # L [题面](https://codeforces.com/gym/104345/problem/L) ## Description 称由 $n$ 个点组成的无向图为简单的当且仅当满足如下条件: - 对于任意两个 ......
题解 Petrozavodsk Contest 部分 Winter

SMU Summer 2023 Contest Round 3

# [SMU Summer 2023 Contest Round 3](https://codeforces.com/group/L9GOcnr1dm/contest/450890) ## [A. Curriculum Vitae](https://codeforces.com/group/L9GO ......
Contest Summer Round 2023 SMU

【DP】DMOPC '21 Contest 8 P5 - Tree Building

[Problem Link](https://dmoj.ca/problem/dmopc21c8p5) 给定 $n,m$ 和一个长为 $m$ 的代价序列,对于一棵 $n$ 个节点,每个节点度数不超过 $m$ 的树,定义它的代价为 $\sum\limits_{i=1}^n a_{deg_i}$。求代价 ......
Building Contest DMOPC Tree 39

AtCoder Beginner Contest 161

# AtCoder Beginner Contest 161 https://atcoder.jp/contests/abc161 这套不算难,但是sb我还是写不出来是为什么呢 F是个妙妙题 ## C - Replacing Integer WA了一次所以放上来 ```CC #include #de ......
Beginner AtCoder Contest 161

codeforces-817 D. Imbalanced Array(单调栈)

![image](https://img2023.cnblogs.com/blog/3070624/202307/3070624-20230712121051112-1667145400.png) 题意:求数组中每个连续子序列的的最大值-最小值之和。 思路:题意可以理解为加上每一个序列的最大值,减去 ......
codeforces Imbalanced Array 817

AtCoder Beginner Contest 309 Ex Simple Path Counting Problem

[洛谷传送门](https://www.luogu.com.cn/problem/AT_abc309_h "洛谷传送门") [AtCoder 传送门](https://atcoder.jp/contests/abc309/tasks/abc309_h "AtCoder 传送门") 挺妙的题。 考虑 ......
Beginner Counting AtCoder Contest Problem

AtCoder Grand Contest 012 D Colorful Balls

[洛谷传送门](https://www.luogu.com.cn/problem/AT_agc012_d "洛谷传送门") [AtCoder 传送门](https://atcoder.jp/contests/agc012/tasks/agc012_d "AtCoder 传送门") 不错的题。bx E ......
Colorful AtCoder Contest Grand Balls

The 2019 ICPC China Shaanxi Provincial Programming Contest(2019陕西省赛)

## B. Grid with Arrows 并查集一下。 ```cpp #include "bits/stdc++.h" using namespace std; using i64 = long long; struct UnionFind { int n; vector f; UnionFin ......
2019 Programming Provincial Contest Shaanxi

SystemVerilog Dynamic Array Randomization

https://verificationguide.com/systemverilog/systemverilog-dynamic-array-randomization/ Dynamic Array Randomize For a dynamic array, it is possible to ......
SystemVerilog Randomization Dynamic Array

AtCoder Regular Contest 164 E Segment-Tree Optimization

[洛谷传送门](https://www.luogu.com.cn/problem/AT_arc164_e "洛谷传送门") [AtCoder 传送门](https://atcoder.jp/contests/arc164/tasks/arc164_e "AtCoder 传送门") 妙妙题。 我们考虑 ......

AtCoder Beginner Contest 309 G Ban Permutation

[洛谷传送门](https://www.luogu.com.cn/problem/AT_abc309_g "洛谷传送门") [AtCoder 传送门](https://atcoder.jp/contests/abc309/tasks/abc309_g "AtCoder 传送门") 前置知识:[[AR ......
Permutation Beginner AtCoder Contest 309

CF1814D Balancing Weapons

[CF1814D Balancing Weapons](https://www.luogu.com.cn/problem/CF1814D) 原题明显可以转化为: 给定一个长度为 $n$ 的数组,初始为 $p_i$。可以调整元素的值,但第 $i$ 个元素必须是 $a_i$ 的 **整数** 倍,并且 ......
Balancing Weapons 1814D 1814 CF

Arrays.stream().boxed()的使用

一、Arrays.stream()的使用 使用: 1、获取需要转换的数组 2、使用Arrays.stream()将数组转换为流,且数组作为参数传递 3、返回流 例:将字符串转化为Stream,再转为List public void test(){ String ids="1,2,3,4,5,6,7" ......
Arrays stream boxed

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

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

[Leetcode Weekly Contest]351

链接:[LeetCode](https://leetcode-cn.com/contest/weekly-contest-351/) ## [Leetcode]6451. 找出最大的可达成数字 给你两个整数 num 和 t 。 如果整数 x 可以在执行下述操作不超过 t 次的情况下变为与 num 相 ......
Leetcode Contest Weekly 351

AtCoder Beginner Contest 308

vp做四道 ## E. MEX [E - MEX (atcoder.jp)](https://atcoder.jp/contests/abc308/tasks/abc308_e) ### 题意 给定一个字符串,其中每个字符都有一个权值,找到所有满足$s_is_js_k=$`MEX`的三元组$(i,j ......
Beginner AtCoder Contest 308

AtCoder Beginner Contest 308 Ex Make Q

[洛谷传送门](https://www.luogu.com.cn/problem/AT_abc308_h "洛谷传送门") [AtCoder 传送门](https://atcoder.jp/contests/abc308/tasks/abc308_h "AtCoder 传送门") 这是官方题解的 $ ......
Beginner AtCoder Contest Make 308

【计数,DP】ABC306Ex Balance Scale

[Problem Link](https://atcoder.jp/contests/abc306/tasks/abc306_h) 现在有 $n$ 个球,每个球有一个重量,重量未知。接下来会进行 $m$ 次称重,每次给定 $a_i$ 和 $b_i$,比较这两个球的重量,结果可能是 $>,=, 点击查 ......
Balance Scale ABC 306 Ex

AtCoder Beginner Contest 309 ABCDE

# [AtCoder Beginner Contest 309](https://atcoder.jp/contests/abc309) ## **A - Nine** ### Problem Statement 题意:给你两个数问你是否在图上是相邻的。 ### Solution 思路:按照图写下关 ......
Beginner AtCoder Contest ABCDE 309

AtCoder Regular Contest 164 (A-C)

#A. Ternary Decomposition *思维难度其实可以作为第二题* >##思路 先考虑最优情况下需要多少个数来组成(不够就 No) 在考虑全部为1的情况下是否可行( N ###完整代码 ```cpp #include using namespace std; #define ll l ......
AtCoder Regular Contest 164 A-C

AtCoder Regular Contest 162

# Preface 补题,这样一来军训这段时间口胡的题目就都写完了,后面空余的时间就优先做学校要求的专题了(主要是几何,因为字符串已经基本做完了) 唉现在的计数水平说实话练了这么多还是没有太大长进,有些巧妙的地方就是想不过去,所以打Atcoder就会很难受 不过相信多练总比不练好,可能到时候需要专门 ......
AtCoder Regular Contest 162

AtCoder Beginner Contest 307

A: 1 #include<cstdio> 2 #include<cstring> 3 #include<algorithm> 4 #include<iostream> 5 #include<string> 6 #include<vector> 7 #include<stack> 8 #includ ......
Beginner AtCoder Contest 307

AtCoder Beginner Contest 309

A: 1 #include<cstdio> 2 #include<cstring> 3 #include<algorithm> 4 #include<iostream> 5 #include<string> 6 #include<vector> 7 #include<stack> 8 #includ ......
Beginner AtCoder Contest 309

AtCoder Beginner Contest 273 ABCD

# [AtCoder Beginner Contest 273](https://atcoder.jp/contests/abc273) ## **A - A Recursive Function** ### Problem Statement 题意:给你一个函数$f(x)$ - $f(0)=1$ ......
Beginner AtCoder Contest ABCD 273

AtCoder Beginner Contest 309

> 感觉F写了个乱搞做法 ## [A - Nine (abc309 A)](https://atcoder.jp/contests/abc309/tasks/abc309_a) ### 题目大意 给定一个$3 \times 3$的网格,以及两个数字。 ![tu](https://img.atcode ......
Beginner AtCoder Contest 309

AtCoder Beginner Contest 178(E,F)

# AtCoder Beginner Contest 178(E,F) ## E(计算几何) 给出$n$个点坐标,我们需要知道两个不同的点之间的曼哈顿的最大的那一个,求$max(abs(x_i-x_j)+abs(y_i-y_j))$ 题意很好懂,就是如果按照最简单的想法,可以一个一个找,我们枚举不同 ......
Beginner AtCoder Contest 178