colorful atcoder contest grand
UNIQUE VISION Programming Contest 2023 Summer(AtCoder Beginner Contest 312)
# Preface 最唐氏的一集,尽情欣赏ABC E题战俘的丑态 这场打的时候就很抽象,各种傻逼错误频发,从B题一路WA到G题 还好发现E后面的题更简单后马上把FG写了,不然要爆炸了 # A - Chord 签到 ```cpp #include #include #include #include ......
AtCoder Beginner Contest 165
# AtCoder Beginner Contest 165 https://atcoder.jp/contests/abc165 ## C - Many Requirements dfs ```CC #include using namespace std; const int N = 15, M ......
AtCoder Beginner Contest 312
# A - Chord ```cpp #include using namespace std; int32_t main() { ios::sync_with_stdio(false), cin.tie(nullptr), cout.tie(nullptr); string s; cin >> s ......
[UNIQUE VISION Programming Contest 2023 Summer(AtCoder Beginner Contest 312) - AtCoder](https://atcoder.jp/contests/abc312)
# [UNIQUE VISION Programming Contest 2023 Summer(AtCoder Beginner Contest 312) - AtCoder](https://atcoder.jp/contests/abc312) ## [A - Chord (atcoder.j ......
[ARC119F] AtCoder Express 3
有简单做法,但是pb大神讲了自动机做法。 这么有趣的自动机不去做?亏大发。 有两个重要的观察。 当你出现长度大于 $4$ 的连续段时,一定会向后走一次并跳过这一段。 某些时候,当你能用同样的步数走到最后的两个格子,且中一个是 $\rm A$,一个是 $B$ 时,可以看作你处于一个既能是 $\rm A ......
Atcoder-Beginner-Contest-312 A~Ex
# [$Atcoder-Beginner-Contest-312$](https://atcoder.jp/contests/abc312/) AB过于简单,在此略去。 ## [$C-Invisible$ $Hand$](https://atcoder.jp/contests/abc312/task ......
AtCoder Beginner Contest 312
## [A - Chord (abc312 A)](https://atcoder.jp/contests/abc312/tasks/abc312_a) ### 题目大意 给定一个长度为$3$的字符串,问是不是`ACE, BDF, CEG, DFA, EGB, FAC, GBD`中的一个。 ### ......
(AtCoder Beginner Contest 312)
(AtCoder Beginner Contest 312) A - Chord #include<bits/stdc++.h> using namespace std; #define int long long //#define int __int128 typedef pair<int,in ......
SMU Summer 2023 Contest Round 7
# [SMU Summer 2023 Contest Round 7](https://codeforces.com/group/L9GOcnr1dm/contest/464081) ## [A. Two Rival Students](https://codeforces.com/group/L9 ......
Atcoder ABC259H Yet Another Path Counting
首先可以想到有组合数的方法: 令起点为 $(x1, y1)$,终点为 $(x2, y2)$,则路径方案数就为 $\binom{x2 + y2 - x1 - y1}{x2 - x1}$,这样设有 $k$ 个相同颜色的点,时间复杂度就为 $O(k^2)$。 再考虑到还有 $\text{DP}$ 方法: ......
Atcoder ARC060D Digit Sum
看到 $n\le 10^{11}$,考虑按根号分为两部分处理。 对于 $b\le \sqrt{n}$,考虑直接暴力算 $\operatorname{f}(b, n)$ 判断是否等于 $s$,这部分的计算量是 $O(\sqrt{n})$ 级别的。 对于 $\sqrt{n} n$,这个时候 $\oper ......
SMU Summer 2023 Contest Round 6
# [SMU Summer 2023 Contest Round 6](https://codeforces.com/group/L9GOcnr1dm/contest/462070) ## [A. There Are Two Types Of Burgers](https://codeforces. ......
AtCoder Beginner Contest 311
AtCoder Beginner Contest 311 First ABC 思路:找到第一个a,b,c都出现的位置 #include<bits/stdc++.h> using namespace std; #define int long long //#define int __int128 t ......
AtCoder Beginner Contest 311
# A - First ABC ```cpp #include using namespace std; #define int long long int32_t main() { ios::sync_with_stdio(false), cin.tie(nullptr), cout.tie(nu ......
【python】使用paramiko获取ssh输出,过滤ANSI Color及ANSI Escape字节串
1、ANSI Color及ANSI Escape ANSI Escape Codes · GitHub 2、处理ANSI Color # 7-bit and 8-bit C1 ANSI sequences ansi_escape_8bit = re.compile( br'(?:\x1B[@-Z\\ ......
[Leetcode Weekly Contest]355
链接:[LeetCode](https://leetcode-cn.com/contest/weekly-contest-355/) ## [Leetcode]6921. 按分隔符拆分字符串 给你一个字符串数组 words 和一个字符 separator ,请你按 separator 拆分 word ......
AtCoder Grand Contest 040 E Prefix Suffix Addition
[洛谷传送门](https://www.luogu.com.cn/problem/AT_agc040_e "洛谷传送门") [AtCoder 传送门](https://atcoder.jp/contests/agc040/tasks/agc040_e "AtCoder 传送门") 比较神奇的题。 考 ......
Toyota Programming Contest 2023#4(AtCoder Beginner Contest 311)
# Toyota Programming Contest 2023#4(AtCoder Beginner Contest 311) ## [A - First ABC (atcoder.jp)](https://atcoder.jp/contests/abc311/tasks/abc311_a) * ......
Atcoder ARC058E Iroha and Haiku
题目中的式子转化一下即存在一位 $i$ 使得到 $i$ 时的后缀和存在 $X + Y + Z, Y + Z, Z$,再发现 $X + Y + Z\le 17$,考虑状压。 设 $f_{i, j}$ 为填了 $i$ 个数当前后缀和中存在的数的状态为 $j$(只存 $0\sim X + Y + Z$ 的 ......
AtCoder Beginner Contest 311 G One More Grid Task
[洛谷传送门](https://www.luogu.com.cn/problem/AT_abc311_g "洛谷传送门") [AtCoder 传送门](https://atcoder.jp/contests/abc311/tasks/abc311_g "AtCoder 传送门") 考虑一维怎么做。 ......
Atcoder ABC311F Yet Another Grid Task
发现 $(i, j)$ 若为黑色则就会有一个 $(i, j)$ 为最高点的阶梯形的图形被染黑(阶梯形指对于 $1\le i\le x$ 第 $i$ 列第 $x - i + 1$ 行及以下都是黑色)。 那么能发现其实每个列只需要记录最高的黑色点行数即可,因为及其以下的点肯定都是黑色。 考虑设 $f_{ ......
Atcoder ABC311G One More Grid Task
可以想到枚举最小值同时算出包含其的最大矩阵和。 考虑枚举行的上下界,再枚举最小值然后求出最大的列的范围,因为 $a_{i, j}\ge 1$ 列的范围越广矩阵和也越大。 考虑如何算出列的范围,令第 $i$ 列在选中的行的范围内的最小值为 $mn_i$,则对于 $mn_i$ 的列 的范围 $[l, r ......
「解题报告」Toyota Programming Contest 2023#4(AtCoder Beginner Contest 311)
比赛地址:[Toyota Programming Contest 2023#4(AtCoder Beginner Contest 311) - AtCoder](https://atcoder.jp/contests/abc311) 后记:大家都太强了%%%,如果我做不出第四题就要掉分了。。。 ## ......
Atcoder ARC058B Iroha and a Grid
考虑从第 $b$ 列与第 $b + 1$ 之间分开这个矩阵,钦定 $(i, b)$ 下一步必须走到 $(i, b + 1)$,可以发现这样是不会漏算或算重的。 于是就可以用乘法原理算出这个 $i$ 的贡献:$\binom{(i - 1) + (b - 1)}{i - 1}\times \binom{ ......
The 2023 Guangdong Provincial Collegiate Programming Contest(2023广东省赛)
链接:[https://codeforces.com/gym/104369](https://codeforces.com/gym/104369) ## A. Programming Contest C++ Code ```cpp #include "bits/stdc++.h" using nam ......
Toyota Programming Contest 2023#4(AtCoder Beginner Contest 311)——D
https://atcoder.jp/contests/abc311/tasks/abc311_d ## 思路 题目说如果当前方向的下一个点能走,那么就一直走,否则才能转向。根据题意模拟即可,这道题的难点在于,碰到已经走过的点到底要不要走。如果当前方向走到底,其中的点之前全部都走过那么就不能再走了。 ......
练习记录-AtCoder Beginner Contest 311-(A-E)
写的还挺顺的 F之后补 A - First ABC 找abc三个字母什么时候出现了一次 输出即可 B - Vacation Together 题意:最长的几个人一排里面均有时间 #include<bits/stdc++.h> #define close std::ios::sync_with_std ......
AtCoder Beginner Contest 311
## **E - Defect-free Squares** >给你一个$n \times m$的方格矩阵,矩阵上有一些洞,然后让你求出所有的不含洞的正方形数量 > >$1 \leq n,m \leq 3000$ ### 题解:二维前缀和 + 二分答案 >* 我们先考虑一维上的问题,假设一维上有些位 ......
AtCoder Beginner Contest 311 A-E题解
# A - First ABC ## 题意 给一个长度为N的仅由ABC三个字符组成的字符串S,问S中ABC三个字符第一次出现的位置的最大值。 ## 题解 使用`map`判重,记录当前不同的字符串的个数`cnt`,当`cnt`等于3时,输出此时的下标+1作为答案。 ## Code ```cpp #in ......
AtCoder Beginner Contest 311
## [A - First ABC (abc311 A)](https://atcoder.jp/contests/abc311/tasks/abc311_a) ### 题目大意 给定一个字符串,问最短的一个前缀,包含`A B C`这三个字符。 ### 解题思路 注意到这个前缀的末尾字母一定是这三个 ......