hdu 多校训练题。字符串的开始。 Description When we display a string on a LED screen, there may be different energy consumptions for displaying different characters. Given a string $S$ with...
解题报告
CF1499D The Number of Pairs【数学】【枚举】【筛素数】
有一点点难的数学题。 Description You are given three positive (greater than zero) integers $c$, $d$ and $x$. You have to find the number of pairs of positive integers $(a,b)$ such tha...
CF102920L Two Buildings【分治】【决策单调性】
优秀的分治题目。是“2020-2021 ACM-ICPC, Asia Seoul Regional Contest”的一道题。 Description There are $n$ buildings along a horizontal street. The buildings are next to each other along the...
CF102780D Power play【数学】【二分】【快速幂】
终于有用高中/大学学到的知识能做的题了。 Description While analyzing a mathematical problem, a programmer, Basil by name, noticed an interesting fact: for the numbers $2$ and $4$ holds the ...
CF1336A Linova and Kindom 【图论】【树形DP】【贪心】
一道比较简单的树题,如果题目想复杂了可以找一些性质简化一下。 Description Writing light novels is the most important thing in Linova's life. Last night, Linova dreamed about a fantastic kin...
bzoj2121 字符串游戏 题解【区间DP】
区间 DP 的新经典套路。 Description BX 正在进行一个字符串游戏,他手上有一个字符串 $L$,以及其他一些字符串的集合 $S$,然后他可以进行以下操作:对于一个在集合 $S$ 中的字符串 $p$,如果 $p$ 在 $...
洛谷 P3317 [SDOI2014]重建【矩阵树定理】【概率期望】
不是那么简单的矩阵树。 题目描述 T 国有 $N$ 个城市,用若干双向道路连接。一对城市之间至多存在一条道路。 在一次洪水之后,一些道路受损无法通行。虽然已经有人开始调查道路的损毁情况,但直到...
GuOJ 1198「HB 省队互测 2019 Round1 Day1」轮回 题解【DP】
dp 能力又一次严重下降。 题目背景 孤独者的唯一救赎就是绝对而永恒的孤独。 北斗是一个喜欢玩游戏的女孩子。 今天她蒯来一部叫《CROSS † CHANNEL》的游戏准备玩,但是没玩几下就发现,...
GuOJ 1200「HB 省队互测 2019 Round1 Day2」游戏 题解【FWT】【DP】
子集卷积这个东西终于学到了啊,被喷 9012 年还有人不会 FST 的就是我了。 题目背景 北斗是一个爱玩游戏的女孩子。 题目描述 北斗有 $n$ 部游戏要玩,这些游戏以 $0\sim n-1$ 标号。她准备花...
洛谷 P5339 [TJOI2019]唱、跳、rap和篮球 题解【容斥】【meet-in-middle】【递推】【排列组合】
计数问题首推容斥,然后再解决一些棘手的组合问题? 题目描述 大中锋的学院要组织学生参观博物馆,要求学生们在博物馆中排成一队进行参观。 他的同学可以分为四类:一部分最喜欢唱、一部分最喜欢跳...