题解atcoder agc 004

AT_arc067_f 题解

[传送门](https://www.luogu.com.cn/problem/AT_arc067_d) ## Simplify 不难想到其实题意就是让你求: $$ \max_{1\le l\le r\le n}\left\{\sum_{i=1}^m\max_{l\le j\le r}\{b_{i,j ......
题解 AT_arc 067 arc AT

ABC143F 题解

## 前言 [题目传送门!](https://www.luogu.com.cn/problem/AT_abc143_f) [更好的阅读体验?](https://www.cnblogs.com/liangbowen/p/17514668.html) 很有趣的题。提供一种和现有题解略微不同的做法。 ## ......
题解 143F ABC 143

B0628 模拟赛题解

[**原题链接**](https://local.cwoi.com.cn:8443/contest/C0276) ## 前言 隔天考试食不食油饼。 感受: > 难度还是佛如 C 组。 > > T1 用 1.5 h 想出正解,是道比较好想的博弈论。 > > T2 一开始居然想的树剖(脑子抽了),实际可 ......
模拟赛 题解 B0628 0628

「ARC133E」Cyclic Medians 题解

本文网址:https://www.cnblogs.com/zsc985246/p/17513317.html ,转载请注明出处。 ## 传送门 [「ARC133E」Cyclic Medians](https://atcoder.jp/contests/arc133/tasks/arc133_e) # ......
题解 Medians Cyclic 133E ARC

Codeforces[CF1036B]Diagonal Walking v.2题解

# 题目大意 很明显,这道题就是求 k 步之内到达点 $(a,b)$ ,然后尽量走对角线,求能走对角线的最大值。 # 做题思路 首先明白一个事实,即一个对角线可以通过增加一步而抵达点不变,如图: ![image](https://img2023.cnblogs.com/blog/3175066/20 ......
题解 Codeforces Diagonal Walking 1036B

AtCoder Beginner Contest 280 ABCDE

# [AtCoder Beginner Contest 280](https://atcoder.jp/contests/abc280) ## **A - Pawn on a Grid** ### Problem Statement 题意:给你$N$行$M$列的网格,问你有多少个# ### Solu ......
Beginner AtCoder Contest ABCDE 280

AtCoder Beginner Contest(abc) 297

*** ## B - [chess960](https://atcoder.jp/contests/abc297/tasks/abc297_b) #### 题目大意 >给定一串字符串, 里面一定包含2个' B ', 2个' R ', 1个' K ', 问该字符串是否满足以下两个条件, 一是两个'B' ......
Beginner AtCoder Contest 297 abc

AtCoder Beginner Contest 296 Ex Unite

[洛谷传送门](https://www.luogu.com.cn/problem/AT_abc296_h "洛谷传送门") [AtCoder 传送门](https://atcoder.jp/contests/abc296/tasks/abc296_h "AtCoder 传送门") 不错的 dp。 考 ......
Beginner AtCoder Contest Unite 296

AGC012E Camel and Oases

## 题意 有一个数轴上有 $n$ 个点。一开始有一个参数 $v$,你可以进行任意次移动,直到 $v = 0$: - 移动到一个距离当前点不超过 $v$ 的点,$v$ 不变。 - 移动到任何一个点,使得 $v \gets \lfloor\dfrac{v}{2}\rfloor$。 现在对于每个起点,问 ......
Camel Oases 012E AGC 012

Switches and Lamps 题解

[题目传送门](https://www.luogu.com.cn/problem/CF985B) 一道枚举题。 首先我们需要知道什么开关才能被去掉,题目要求去掉这个开关后所有的灯依然能够开启。也就是说,**这个开关能打开的所有灯都可以由其它开关代替**。 思路清晰了,就比较好做。我们可以用一个数组存 ......
题解 Switches Lamps and

AtCoder Beginner Contest 227 H Eat Them All

[洛谷传送门](https://www.luogu.com.cn/problem/AT_abc227_h "洛谷传送门") [AtCoder 传送门](https://atcoder.jp/contests/abc227/tasks/abc227_h "AtCoder 传送门") 好奇特的题。 考虑 ......
Beginner AtCoder Contest Them 227

P1552 [APIO2012] 派遣 题解

一、题目描述: 给你一个 $n$ 个点的有根树,每个点有两个参数 $w$ 和 $v$ 。再给出一个数 $m$ 。 对于每一个点 $u$ ,设它的子树内最多可以选择 $k_u$ 个点 $a_1,a_2,...,a_{k_u}$,使得 $\sum _{i=1}^k w_{a_i} \le m$ 。 那么 ......
题解 P1552 1552 APIO 2012

解密2.0题解

[解密题目](https://www.luogu.com.cn/problem/U284212) 首先查看题目的$\LaTeX$源代码,发现在 `答案` 后面有一个 `。` 可以点击。点击这个句号,来到线索 $1$。 ### 线索 $1$: 在源代码里发现有 `base64` 这个字眼,于是就把后面 ......
题解 2.0

AtCoder Beginner Contest 306(ABC 306) E~F补题

# E ### 题目大意 给定数字\$k\$,规定数组 $A$ 的函数 $f(A)$ :$A$ 数组前 $k$ 大数字的和 - 如 $A=[1,~3,~7,~4]$ ,$k=2$ ,则 $f(A)=7+4=11$ 现在给定最大数组长度 $n$ ,有 $q$ 组操作,每次将第 $x$ 个数字修改为 $ ......
306 Beginner AtCoder Contest ABC

CF1834 题解

# CF1834 题解 ### A 考虑答案与元素位置无关,只与$1$和$-1$的个数有关。要求$1$必须多于或等于$-1$,并且$-1$个数为偶数。分讨: 序列中$num(1) \geq num(-1)$,只需要看$num(-1)$正负性,奇数1步,偶数0步 序列中$num(1) using na ......
题解 1834 CF

AtCoder Beginner Contest 228 G Digits on Grid

[洛谷传送门](https://www.luogu.com.cn/problem/AT_abc228_g "洛谷传送门") [AtCoder 传送门](https://atcoder.jp/contests/abc228/tasks/abc228_g "AtCoder 传送门") ?这啥啊,不会。 ......
Beginner AtCoder Contest Digits Grid

洛谷P5380 [THUPC2019] 鸭棋 题解

# 洛谷P5380 [THUPC2019] 鸭棋 题解 ## 闲话 其实之前我没想碰大模拟的……这次的起因是 wjy同学 那天提到了要卷点大模拟,而猪国杀感觉太过复杂,于是我就选了鸭棋( 这是我第一道,大概也是最后一道大模拟了…… 然后还是对着数据点二一点点改出来的 qwq,调试代码的过程真的好痛苦 ......
题解 P5380 THUPC 5380 2019

P4630 [APIO2018] 铁人两项 题解

一、题目描述: 给你一个 $n$ 个点,$m$ 条边的无向图。图不一定联通 求出点对 $( u,c,v )$ 的数量,使得点 $u$ 存在一条经过点 $c$ 到达点 $v$ 的无向图。 数据范围:$1 \le n \le 1 \times 10^5,1 \le m \le 2 \times 10^5 ......
题解 铁人 P4630 4630 2018

CF1580D Subsequence 题解

本文网址:https://www.cnblogs.com/zsc985246/p/17509039.html ,转载请注明出处。 ## 传送门 [CF1580D Subsequence](https://codeforces.com/contest/1580/problem/D) ## 题目大意 有 ......
题解 Subsequence 1580D 1580 CF

AtCoder Beginner Contest 072

# A - Sandglass2 ```cpp #include using namespace std; #define int long long int32_t main() { int a , b; cin >> a >> b; cout using namespace std; #defi ......
Beginner AtCoder Contest 072

【AGC】云数据库云侧Python SDK集成使用方法

​使用场景 云数据库服务端以前支持Node.JS和Java平台的Server SDK。现在介绍一下服务端为Python平台时的使用方法。 集成准备 Python环境配置 1.下载Python和PyCharm并安装。 ​ ​ 2.使用安装的python本身作为解释器。 ​​ 3.安装AGC Pytho ......
使用方法 数据库 方法 数据 Python

AtCoder Beginner Contest 238 Ex Removing People

[洛谷传送门](https://www.luogu.com.cn/problem/AT_abc238_h "洛谷传送门") [AtCoder 传送门](https://atcoder.jp/contests/abc238/tasks/abc238_h "AtCoder 传送门") 考虑期望转计数,方 ......
Beginner Removing AtCoder Contest People

B0626 模拟赛题解

[原题链接](https://local.cwoi.com.cn:8443/contest/C0272) # 前言 重庆一位金牌大佬出的。 感受: >除了最后一题,感觉难度不如 C 组,甚至没之前 D 组题难? > >T1 浪费 2.5 h,最后还是打表秒了。 > >T2 想出正解,但发现是数据结构 ......
模拟赛 题解 B0626 0626

CodeForces 605E Intergalaxy Trips 题解

## 题意 > 有一张 $n$ 个点的有向完全图,边 $i \to j$ 有 $p_{i,j}$ 的概率出现($p_{i,i}=1$)。你要从 $1$ 开始,每天可以走一条出边或留在原地,求最优策略下走到 $n$ 的期望天数。输出小数(不取模)。 > $n \le 10^3$ ## 思路 设 $f( ......
题解 Intergalaxy CodeForces Trips 605E

P3387 【模板】缩点 题解

一、题目描述: 给你一个 $n$ 个点,$m$ 条边的有向图。点带权。 求一条路径经过的所有点的权值和最大是多少。点可以重复经过。 数据范围:$1 \le n \le 1 \times 10^4,1 \le m \le 1 \times 10^5$ 。 二、解题思路: 缩点板子题,不需要思路。时间复 ......
题解 模板 P3387 3387

AtCoder Beginner Contest 307 Ex Marquee

[洛谷传送门](https://www.luogu.com.cn/problem/AT_abc307_h "洛谷传送门") [AtCoder 传送门](https://atcoder.jp/contests/abc307/tasks/abc307_h "AtCoder 传送门") 一开始看错题了,看 ......
Beginner AtCoder Contest Marquee 307

AtCoder Beginner Contest(abc) 307

*** ## A - [Weekly Records](https://atcoder.jp/contests/abc307/tasks/abc307_a) #### 题目大意 >小莫每天跑步, 输入n周每天的步数, 输出每周跑的总步数; #### 解题思路 >签到题不多嗦了; #### 神秘代码 ......
Beginner AtCoder Contest 307 abc

P3388 【模板】割点(割顶) 题解

一、题目描述: 给你一个 $n$ 个点,$m$ 条边的无向图。 求出所有割点,按节点编号升序排序。 数据范围:$1 \le n \le 2\times 10^4,1 \le m \le 1 \times 10^5$ 。 二、解题思路: 板子题,不需要思路。时间复杂度 $O(n+m)$ 。 三、完整代 ......
题解 模板 P3388 3388

AtCoder Beginner Contest 307 G Approximate Equalization

[洛谷传送门](https://www.luogu.com.cn/problem/AT_abc307_g "洛谷传送门") [AtCoder 传送门](https://atcoder.jp/contests/abc307/tasks/abc307_g "AtCoder 传送门") 考虑我们如果确定了 ......

AtCoder Beginner Contest 245 Ex Product Modulo 2

[洛谷传送门](https://www.luogu.com.cn/problem/AT_abc245_h "洛谷传送门") [AtCoder 传送门](https://atcoder.jp/contests/abc245/tasks/abc245_h "AtCoder 传送门") 很好的题。 下文令 ......
Beginner AtCoder Contest Product Modulo