ex

ABC314EX 题解

模拟退火的题解。 题目的难点在于如何计算点到所有线段的距离。 我们可以通过求线段的直线解析式,然后计算与其垂直的直线的斜率,将随机出来的点带入求得直线解析式,然后求两直线交点,判断是否在线段上进行分讨即可,但是我可能写挂了,所以改成用的向量。 ![](https://cdn.luogu.com.cn ......
题解 ABC 314 EX

[ABC254Ex] Multiply or Divide by 2 题解

### 前言 [传送门](https://www.luogu.com.cn/problem/AT_abc254_h) 仅次于文本编辑器的紫水题(草 ### 题意 给你两个集合 $A$ 和 $B$ ,你可以把集合 $A$ 的任意一项变为原来的 $\left \lfloor\frac{1}{2}\rig ......
题解 Multiply Divide ABC 254

【八月ex】CF选做

## 86D 莫队。 移动指针的贡献:$cnt_i\times cnt_i\times i$。 ## 600E Dsu on Tree 的板子之一。 对于轻儿子暴力统计并且每次统计之后删除贡献,重儿子统计后向上不断合并。 对于这个题而言,你需要统计的信息是对于一个点,它的孩子中占主导地位的颜色是哪个 ......

sol. ABC246Ex

动态 DP 模板题 [[ABC246Ex] 01? Queries](https://atcoder.jp/contests/abc246/tasks/abc246_h) 题目大意:给定一个长度为 $N$ 且只包含 ```?```,```1```,```0``` 的字符串 $a$。$Q$ 次操作,每 ......
sol ABC 246 Ex

『题解』ABC261Ex Game on Graph

[题目链接](https://atcoder.jp/contests/abc261/tasks/abc261_h) 震惊!这个题竟然被神犇 szs 放进了博弈论里!我真的没看出来除了题面还有哪里像博弈论(也许是因为我菜)。 转移方式很显然,按照题面说的做就行了。那么正解也就呼之欲出了。 但是我知道大 ......
题解 Graph Game ABC 261

AtCoder Beginner Contest 314 A - Ex题解

# AtCoder Beginner Contest 314 ## A - 3.14 嗯,你可以用string 存小数点后的... ## B - Roulette 对于每一个金额,用个vector存 pair 存一个人赌了多少,以及是哪一个人 。 ## C - Rotate Colored Subs ......
题解 Beginner AtCoder Contest 314

原根 (ex)BSGS 二次剩余 NTT

### 阶 由欧拉定理得 $a^{\varphi(m)}\equiv1\space(\text{mod}\space m),(a,m)=1$ . 故满足 $a^n\equiv1\space(\text{mod}\space m)$ 的最小 $n$ 存在,称为 $a$ 模 $m$ 的阶,记作 $\de ......
BSGS NTT ex

[ABC311Ex] Many Illumination Plans

银牌题,zlt差点ak。 发现我们只关注保留下来的结点,每个保留的结点的父亲是他祖先中第一个保留的结点,则数颜色不同的条件相当于新树相邻结点颜色不同。 考虑dp,设 $dp_{u,X,0/1}$ 表示 $u$ 子树内最上方的结点颜色为 $0/1$,树的总重量为 $X$ 的最大价值。每次转移就是暴力做 ......
Illumination Plans Many ABC 311

ex

ex 启动vim编辑器的ex编辑模式 ## 补充说明 在 **ex** 模式下启动vim文本编辑器。ex执行效果如同`vi -E`,适用于法及参数可参照vi指令,如要从Ex模式回到普通模式,则在vim中输入`:vi`或`:visual`即可。 ### 语法 ```shell ex(参数) ``` # ......
ex

[ABC312] 题解 [D~Ex]

# [ABC312] 题解 [D~Ex] ## **D - Count Bracket Sequences** 一个括号序列 $s$ 包含 `(, ), ?`,`?` 可以填任意括号,问你填完后有多少种合法序列方式。 这是一个 Classical 的 括号序列 DP,使用这个状态表示可以解决很多括号 ......
题解 ABC 312 Ex

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 ......

ABC248Ex Beautiful Subsequences

![](https://cdn.luogu.com.cn/upload/image_hosting/rft7d5d2.png) 然而这个经典做法是分治,我不太会做,但这确实是一道经典题。 考虑扫描线,对从左到右每个点 $r$,统计以 $r$ 作为右端点的区间个数。 由于 $r$ 端点固定,$S(l) ......
Subsequences Beautiful ABC 248 Ex

ABC308Ex Make Q

一个 $O(n^3\log n)$ 的做法。 我们考虑枚举在环上连向外部的那个点 $u$,然后再在点集 $\{1,2,\cdots u-1,u+1,\cdots n-1,n\}$ 的导出子图中跑 Floyd,枚举 $u$ 在环上相邻的两个点 $x,y$,答案就是 $d_{x,y}+w_{x,u}+w ......
Make ABC 308 Ex

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 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

WS_EX_TOOLWINDOW 可能导致的窗口无响应问题

最近在写一个Direct2D的透明窗口,目的就是透明窗口上画字,然后改在游戏表面当字幕用开始用的GDI和GDI+方案效果都不怎么样,Direct2D好很多,自由控制alpha 大概方案就是,创建内存DC,然后用Direct2D的DC绘制,最后用UpdateLayeredWindow 不过正当我准备收 ......
WS_EX_TOOLWINDOW TOOLWINDOW 问题 WS EX

AT_nikkei2019ex_h 题解

## 思路 这是一道博弈题,最优策略是高桥的 $k$ 一直是 $1$,青木的 $k$ 一直是 $0$,可以保证拿走的硬币不超过剩下的硬币,这样每次两人都取完后拿走硬币的数量是 $8^1+8^0$,结果是 $9$,那么就用 $N\bmod9$,得出的结果就是剩下的硬币。 如果结果是 $0$,那么最后拿 ......
题解 AT_nikkei nikkei 2019 ex_h

AT_nikkei2019ex_e 题解

## 思路 进题扫一眼题目描述,可以写成这样: ![](https://img2023.cnblogs.com/blog/3200809/202307/3200809-20230707102859912-1554332013.png) 是不是很眼熟?这不就是角谷猜想嘛,但它不是让我们求步数果,而是求 ......
题解 AT_nikkei nikkei 2019 ex_e

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

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

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 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

AtCoder Beginner Contest 252 Ex K-th beautiful Necklace

[洛谷传送门](https://www.luogu.com.cn/problem/AT_abc252_h "洛谷传送门") [AtCoder 传送门](https://atcoder.jp/contests/abc252/tasks/abc252_h "AtCoder 传送门") ~~不知道为什么可 ......
beautiful Beginner Necklace AtCoder Contest

AtCoder Beginner Contest 235 Ex Painting Weighted Graph

[洛谷传送门](https://www.luogu.com.cn/problem/AT_abc235_h "洛谷传送门") [AtCoder 传送门](https://atcoder.jp/contests/abc235/tasks/abc235_h "AtCoder 传送门") 为啥洛谷唯一一篇题 ......
Beginner Painting Weighted AtCoder Contest

[ABC282Ex] Min + Sum

[ABC282Ex] Min + Sum 一道分治题。比较新的地方在于,别的题都是按中点为M分治,而这道题是按最小值为M分治。记录b的前缀和sum。【L,R】最小值为M,则分为【L,M-1】,【M+1,R】。 #include<bits/stdc++.h> using namespace std; ......
ABC 282 Min Sum Ex

AtCoder Beginner Contest 242 Ex Random Painting

[洛谷传送门](https://www.luogu.com.cn/problem/AT_abc242_h "洛谷传送门") [AtCoder 传送门](https://atcoder.jp/contests/abc242/tasks/abc242_h "AtCoder 传送门") 好久没复习过 mi ......
Beginner Painting AtCoder Contest Random

AtCoder Beginner Contest 253 Ex We Love Forest

[洛谷传送门](https://www.luogu.com.cn/problem/AT_abc253_h "洛谷传送门") [AtCoder 传送门](https://atcoder.jp/contests/abc253/tasks/abc253_h "AtCoder 传送门") 没做出来。 考虑求 ......
Beginner AtCoder Contest Forest Love

AtCoder Beginner Contest 298 Ex Sum of Min of Length

[洛谷传送门](https://www.luogu.com.cn/problem/AT_abc298_h "洛谷传送门") [AtCoder 传送门](https://atcoder.jp/contests/abc298/tasks/abc298_h "AtCoder 传送门") 挺无脑的。是不是因 ......
Beginner AtCoder Contest Length of

AtCoder Beginner Contest 290 Ex Bow Meow Optimization

[洛谷传送门](https://www.luogu.com.cn/problem/AT_abc290_h "洛谷传送门") [AtCoder 传送门](https://atcoder.jp/contests/abc290/tasks/abc290_h "AtCoder 传送门") 考虑观察答案形态。 ......
Optimization Beginner AtCoder Contest Meow