随笔分类 - 数学-组合-计数类
摘要:题目 Bessie the cow is trying to walk from her favorite pasture back to her barn. The pasture and farm are on an N×N grid (2≤N≤50 ), with her pasture in
阅读全文
摘要:题目链接 由于BZOJ已挂,这里是黑暗爆炸和hydro的备份 黑暗爆炸: 国王奇遇记 国王奇遇记加强版 hydro: 国王奇遇记 国王奇遇记加强版 题目 Katharon 国有着悠久的历史,每个慕名而来的游客都渴望能在 Katharon 国发现一些奇怪的宝藏。而作为国王的 Kanari 君也梦想着有
阅读全文
摘要:题目链接 题目 You are given a sequence of numbers a1, a2, ..., an, and a number m. Check if it is possible to choose a non-empty subsequence aij such that t
阅读全文
摘要:题目链接 题目 Define the distance between two strings of the same length as the numbers of the positions where the characters differ in these two strings. I
阅读全文
摘要:题目链接 题目 Your company has just constructed a new skyscraper, but you just noticed a terrible problem: there is only space to put one game room on each
阅读全文
摘要:题目链接 题目 There is a n×m board, a chess want to go to the position (n,m) from the position (1,1). The chess is able to go to position (x2,y2) from the p
阅读全文
摘要:题目链接 我们先对于有向图缩点,变成一棵树。 然后我们对于每个树上且在原图中的分割点节点所对应原图中的连通块考虑。 假设这里没有割点,很明显,只需要放2个出口即可。 如果有一个割点,说明这个点是树上的叶子节点,需要放1个出口。 如果有两个或以上的割点,无论哪个割点被割,都可以往另一个方向逃,所以这个
阅读全文
摘要:题目链接 首先这个点删去之后必然与剩下 个点失去相连。 如果这个点能使其它点失去相连,说明这个点为割点。 然后统计一下每个儿子与父亲的影响即可。 Code // Problem: #10104. 「一本通 3.6 练习 5」Blockade // Contest: LibreOJ /
阅读全文
摘要:题目链接 看题,发现是一个缩点。 缩完点后,对于每一个强连通分量,取其汽油费的最小值,最小值的和就是答案。 方案就是每个强连通分量最小值个数相乘。 Code // Problem: P2194 HXY烧情侣 // Contest: Luogu // URL: https://www.luogu.co
阅读全文