Loading

摘要: 题面 考虑暴力 dp:设 \(dp[i][j]\) 表示在以 \(i\) 为根的子树中选的包含节点 \(i\) 的连通块的价值为 \(j\) 的方案数,转移时合并儿子的 dp 状态即可。复杂度 \(O(n\times m^2)\)。 这个暴力慢在合并两个儿子的状态,因为合并两个 dp 数组是 \(O 阅读全文
posted @ 2023-03-28 16:39 Galetx 阅读(45) 评论(0) 推荐(0)
摘要: 洛谷P3806 #include <bits/stdc++.h> using namespace std; int read() { int s = 0, f = 1; char ch = getchar(); while (ch < '0' || ch > '9') f = (ch == '-' 阅读全文
posted @ 2023-03-28 15:02 Galetx 阅读(26) 评论(0) 推荐(0)
摘要: P5357 #include <bits/stdc++.h> #define int long long #define N 200005 using namespace std; int n, cnt[N] = {0}; string s[N], t; map<string, int> apr; 阅读全文
posted @ 2023-03-28 14:18 Galetx 阅读(19) 评论(0) 推荐(0)
摘要: KMP 洛谷P3375 #include <bits/stdc++.h> #define int long long using namespace std; int read() { int s = 0, f = 1; char ch = getchar(); while (ch < '0' || 阅读全文
posted @ 2023-03-28 13:58 Galetx 阅读(21) 评论(0) 推荐(0)
摘要: 前置知识:整除分块 结论:集合 ${x|\exists i\in \mathbb N^*,\lfloor \frac n i\rfloor =x}$ 中的元素数量为 $\sqrt n$ 级别个。具体来说,不超过 $2\sqrt n$ 个。 证明:对于 $i \le \sqrt n$,$\lfloor 阅读全文
posted @ 2023-03-28 11:22 Galetx 阅读(32) 评论(0) 推荐(0)
摘要: 简介 博弈论,是经济学的一个分支,主要研究具有竞争或对抗性质的对象,在一定规则下产生的各种行为。博弈论考虑游戏中的个体的预测行为和实际行为,并研究它们的优化策略。 通俗地讲,博弈论主要研究的是:在一个游戏中,进行游戏的多位玩家的策略。 公平组合游戏 博弈论中,一般主要研究公平组合游戏。公平组合游戏( 阅读全文
posted @ 2023-03-28 11:06 Galetx 阅读(336) 评论(0) 推荐(0)