摘要: 题目 P1494 [国家集训队]小Z的袜子 思路 \(ans = \sum_{i = 1}^{n} p_i\),\(p_i\) 是拿到两根颜色为 \(i\) 的袜子的概率。 \(p_i = \dfrac{s_i \times (s_i - 1)}{len\times (len - 1)}\),\(s 阅读全文
posted @ 2020-10-30 16:07 yu__xuan 阅读(65) 评论(3) 推荐(1) 编辑
摘要: 题目 P2709 小B的询问 思路 莫队板子,统计数字出现次数。 Code #include <cmath> #include <cstdio> #include <cstring> #include <string> #include <iostream> #include <algorithm> 阅读全文
posted @ 2020-10-30 14:49 yu__xuan 阅读(43) 评论(0) 推荐(0) 编辑
摘要: 题目 SP3267 DQUERY - D-query 思路 莫队板子,统计数字出现次数。 Code #include <cmath> #include <cstdio> #include <cstring> #include <string> #include <iostream> #include 阅读全文
posted @ 2020-10-30 14:46 yu__xuan 阅读(50) 评论(0) 推荐(0) 编辑