07 2023 档案
摘要:[洛谷传送门](https://www.luogu.com.cn/problem/CF888F "洛谷传送门") [CF 传送门](https://codeforces.com/problemset/problem/888/F "CF 传送门") 做做简单题放松身心。 考虑区间 dp,设 $f_{i
阅读全文
摘要:Boruvka 算法的思想基于每个点的最短邻边一定在最小生成树上。算法流程是每轮对每个连通块找到一条连向另一连通块的最短边,然后合并两端点。因为每轮连通块数量至少减半,所以一共会进行 轮。 相比 Kruskal 和 Prim,Boruvka 在求稠密图的最小生成树上具有优
阅读全文
摘要:[洛谷传送门](https://www.luogu.com.cn/problem/CF1648E "洛谷传送门") [CF 传送门](https://codeforces.com/problemset/problem/1648/E "CF 传送门") 被一道题创了三天 我们
阅读全文
摘要:[洛谷传送门](https://www.luogu.com.cn/problem/CF1268E "洛谷传送门") [AtCoder 传送门](https://codeforces.com/problemset/problem/1268/E "AtCoder 传送门") 考虑一些简单的情况,比如树。
阅读全文
摘要:[洛谷传送门](https://www.luogu.com.cn/problem/CF725F "洛谷传送门") [CF 传送门](https://codeforces.com/problemset/problem/725/F "CF 传送门") 不错的贪心题。 我们考虑一对照片只有一张的情况。那么
阅读全文
摘要:[洛谷传送门](https://www.luogu.com.cn/problem/AT_agc040_e "洛谷传送门") [AtCoder 传送门](https://atcoder.jp/contests/agc040/tasks/agc040_e "AtCoder 传送门") 比较神奇的题。 考
阅读全文
摘要:[洛谷传送门](https://www.luogu.com.cn/problem/CF1810G "洛谷传送门") [CF 传送门](https://codeforces.com/problemset/problem/1810/G "CF 传送门") 感觉是比较 educational 的题。 拿到
阅读全文
摘要:[洛谷传送门](https://www.luogu.com.cn/problem/AT_abc311_g "洛谷传送门") [AtCoder 传送门](https://atcoder.jp/contests/abc311/tasks/abc311_g "AtCoder 传送门") 考虑一维怎么做。
阅读全文
摘要:[洛谷传送门](https://www.luogu.com.cn/problem/CF1776C "洛谷传送门") [CF 传送门](https://codeforces.com/problemset/problem/1776/C "CF 传送门") orz p_b_p_b。 下文令 为
阅读全文
摘要:[洛谷传送门](https://www.luogu.com.cn/problem/P8490 "洛谷传送门") [LOJ 传送门](https://loj.ac/p/3830 "LOJ 传送门") 不算很难的题,但是调起来比较恶心。 下文默认下标从 开始。 设第 列长堤的高度为 $h
阅读全文
摘要:[UOJ 传送门](https://uoj.ac/problem/450 "UOJ 传送门") 时答案显然为 。 下面只讨论 的情况, 类似。 设每个人的指数型生成函数(EGF)为 $G(x) = \sum\limits_{i = 0}^{+\
阅读全文
摘要:式子: 最常见的应用是 \([x \equiv y \pmod n] = [n \mid (x - y)] = \sum\limits_{i = 0}^{n
阅读全文
摘要:[洛谷传送门](https://www.luogu.com.cn/problem/AT_agc049_e "洛谷传送门") [AtCoder 传送门](https://atcoder.jp/contests/agc049/tasks/agc049_e "AtCoder 传送门") 好题。同时考查了
阅读全文
摘要:洛谷传送门 感觉跟 CF Gym 102978H Harsh Comments 很像。 考虑容斥,钦定 中的人比 后死。设 为 中的人比 后死的概率,那么答案为: \[ans = \sum\limit
阅读全文
摘要:[洛谷传送门](https://www.luogu.com.cn/problem/AT_agc032_d "洛谷传送门") [AtCoder 传送门](https://atcoder.jp/contests/agc032/tasks/agc032_d "AtCoder 传送门") 设 为
阅读全文
摘要:[洛谷传送门](https://www.luogu.com.cn/problem/CF1848E "洛谷传送门") [CF 传送门](https://codeforces.com/problemset/problem/1848/E "CF 传送门") 感觉比这场的 F 简单。 发现我们要进行
阅读全文
摘要:[洛谷传送门](https://www.luogu.com.cn/problem/CF1844G "洛谷传送门") [CF 传送门](https://codeforces.com/problemset/problem/1844/G "CF 传送门") 出题人脑洞真大…… 设 为
阅读全文
摘要:[洛谷传送门](https://www.luogu.com.cn/problem/CF1844C "洛谷传送门") [CF 传送门](https://codeforces.com/problemset/problem/1844/C "CF 传送门") 原题是 [[ARC092E] Both Side
阅读全文
摘要:[洛谷传送门](https://www.luogu.com.cn/problem/AT_arc092_c "洛谷传送门") [AtCoder 传送门](https://atcoder.jp/contests/arc092/tasks/arc092_c "AtCoder 传送门") Key obser
阅读全文
摘要:[洛谷传送门](https://www.luogu.com.cn/problem/P6667 "洛谷传送门") 点值不好搞。考虑把它搞成系数一类的东西。 由二项式反演,$f(x) = \sum\limits_{i = 0}^x \binom{x}{i} b_i \Leftrightarrow b_i
阅读全文
摘要:[洛谷传送门](https://www.luogu.com.cn/problem/P4548 "洛谷传送门") 结论:答案为 。 记一下两种理解方法。 假设有人开了一个赌场,每一秒钟有一位赌
阅读全文
摘要:[洛谷传送门](https://www.luogu.com.cn/problem/AT_abc309_h "洛谷传送门") [AtCoder 传送门](https://atcoder.jp/contests/abc309/tasks/abc309_h "AtCoder 传送门") 挺妙的题。 考虑
阅读全文
摘要:[洛谷传送门](https://www.luogu.com.cn/problem/AT_agc012_d "洛谷传送门") [AtCoder 传送门](https://atcoder.jp/contests/agc012/tasks/agc012_d "AtCoder 传送门") 不错的题。bx E
阅读全文
摘要:[洛谷传送门](https://www.luogu.com.cn/problem/P6892 "洛谷传送门") 感觉这题递归的思想挺值得借鉴的。 特判 。 首先根据样例不难猜测最小次数为 。事实上最小次数下界为 ,因为设 为当前相邻元素相同对数,不难发现除第一次操作
阅读全文
摘要:[CF 传送门](https://codeforces.com/gym/102900/problem/B "CF 传送门") 感觉像脑筋急转弯。 考虑所有数字之和就是相邻的 对数,因此翻转后这个对数不会改变。 然后由于抽屉原理, 和
阅读全文
摘要:[洛谷传送门](https://www.luogu.com.cn/problem/CF1364D "洛谷传送门") [CF 传送门](https://codeforces.com/problemset/problem/1364/D "CF 传送门") 简单题。 特判掉 的情况
阅读全文
摘要:[洛谷传送门](https://www.luogu.com.cn/problem/AT_arc164_e "洛谷传送门") [AtCoder 传送门](https://atcoder.jp/contests/arc164/tasks/arc164_e "AtCoder 传送门") 妙妙题。 我们考虑
阅读全文
摘要:[洛谷传送门](https://www.luogu.com.cn/problem/AT_abc309_g "洛谷传送门") [AtCoder 传送门](https://atcoder.jp/contests/abc309/tasks/abc309_g "AtCoder 传送门") 前置知识:[[AR
阅读全文
摘要:[洛谷传送门](https://www.luogu.com.cn/problem/CF1525F "洛谷传送门") [CF 传送门](https://codeforces.com/problemset/problem/1525/F "CF 传送门") 套路地,将 DAG 的最小不交路径覆盖转化为点数
阅读全文
摘要:[洛谷传送门](https://www.luogu.com.cn/problem/CF1508C "洛谷传送门") [AtCoder 传送门](https://codeforces.com/problemset/problem/1508/C "AtCoder 传送门") 比较需要观察的题。 设 $v
阅读全文
摘要:[洛谷传送门](https://www.luogu.com.cn/problem/CF920E "洛谷传送门") [CF 传送门](https://codeforces.com/problemset/problem/920/E "CF 传送门") 考虑直接暴力 dfs。设搜到点 ,把
阅读全文
摘要:[洛谷传送门](https://www.luogu.com.cn/problem/AT_abc308_h "洛谷传送门") [AtCoder 传送门](https://atcoder.jp/contests/abc308/tasks/abc308_h "AtCoder 传送门") 这是官方题解的 $
阅读全文
摘要:[UOJ 传送门](https://uoj.ac/problem/37 "UOJ 传送门") 考虑 dp。设 为点集 构成强连通分量的方案数。 容易想到容斥。设 为 内部连边数,那么 就是总的方案数 减去构成的不是强连通分量
阅读全文
摘要:[洛谷传送门](https://www.luogu.com.cn/problem/CF1847F "洛谷传送门") [CF 传送门](https://codeforces.com/problemset/problem/1847/F "CF 传送门") 我们首先观察 的形态。令题面中给出的 $
阅读全文
摘要:[洛谷传送门](https://www.luogu.com.cn/problem/CF997C "洛谷传送门") [CF 传送门](https://codeforces.com/problemset/problem/997/C "CF 传送门") 考虑容斥,钦定 行 列放同一种颜色,
阅读全文
摘要:[洛谷传送门](https://www.luogu.com.cn/problem/P6620 "洛谷传送门") 记一下是怎么推的。 $$= \sum\limits_{p = 0
阅读全文
摘要:[洛谷传送门](https://www.luogu.com.cn/problem/AT_agc058_d "洛谷传送门") [AtCoder 传送门](https://atcoder.jp/contests/agc058/tasks/agc058_d "AtCoder 传送门") Orz H6_6Q
阅读全文
摘要:[洛谷传送门](https://www.luogu.com.cn/problem/CF1142E "洛谷传送门") [CF 传送门](https://codeforces.com/problemset/problem/1142/E "CF 传送门") 感觉很神奇啊,想了挺久的。 如果没有粉色边是容易
阅读全文
摘要:[洛谷传送门](https://www.luogu.com.cn/problem/AT_keyence2021_e "洛谷传送门") [AtCoder 传送门](https://atcoder.jp/contests/keyence2021/tasks/keyence2021_e "AtCoder
阅读全文
摘要:[洛谷传送门](https://www.luogu.com.cn/problem/P7722 "洛谷传送门") 被踩爆了好神的题啊! 转化一下题意,给出三个数组 ,每次可以单点修改 ,询问即求 $b_i = a_j = c_k, 1 \l
阅读全文
摘要:[洛谷传送门](https://www.luogu.com.cn/problem/AT_agc033_d "洛谷传送门") [AtCoder 传送门](https://atcoder.jp/contests/agc033/tasks/agc033_d "AtCoder 传送门") 这题感觉实在太 e
阅读全文
摘要:[洛谷传送门](https://www.luogu.com.cn/problem/AT_arc163_d "洛谷传送门") [AtCoder 传送门](https://atcoder.jp/contests/arc163/tasks/arc163_d "AtCoder 传送门") 怎么连这种相对传统
阅读全文
摘要:[洛谷传送门](https://www.luogu.com.cn/problem/AT_arc153_e "洛谷传送门") [AtCoder 传送门](https://atcoder.jp/contests/arc153/tasks/arc153_e "AtCoder 传送门") 我们考虑给定 $X
阅读全文
摘要:[洛谷传送门](https://www.luogu.com.cn/problem/CF1508D "洛谷传送门") [CF 传送门](https://codeforces.com/problemset/problem/1508/D "CF 传送门") 先忽略掉所有 的点。 考虑我
阅读全文
摘要:[洛谷传送门](https://www.luogu.com.cn/problem/AT_abc308_g "洛谷传送门") [AtCoder 传送门](https://atcoder.jp/contests/abc308/tasks/abc308_g "AtCoder 传送门") 考虑没有删除操作怎
阅读全文
摘要:[洛谷传送门](https://www.luogu.com.cn/problem/AT_arc163_c "洛谷传送门") [AtCoder 传送门](https://atcoder.jp/contests/arc163/tasks/arc163_c "AtCoder 传送门") 这题是不是想到裂项
阅读全文
摘要:[洛谷传送门](https://www.luogu.com.cn/problem/AT_agc021_e "洛谷传送门") [AtCoder 传送门](https://atcoder.jp/contests/agc021/tasks/agc021_e "AtCoder 传送门") 容易发现一个变色龙
阅读全文