摘要: 参考教材是清华大学出版社《组合数学》第五版。 第一章 如何组CP 组合(C)与排列(P) 1.6 允许重复的组合与不相邻的集合 允许重复的集合 定义:从 \(A=\{1, 2, \cdots, n\}\) 中取 \(m\) 个元素,允许元素重复。 组合数为 $C(n+m-1,m)$​​ 。证明方法采 阅读全文
posted @ 2021-08-04 15:25 Dayu2001 阅读(108) 评论(0) 推荐(0)
摘要: 参考教材是清华大学出版社《组合数学》第五版。 第一章 如何组CP 组合(C)与排列(P) 1.1 加法法则和乘法法则 ⚠两类事件性质无关,否则考虑容斥原理。 1.2 一一对应法 ⚠一一对应的证明不仅要说明事件 \(A\) 对应事件 \(B\) ,也要说明 \(B\) 对应 \(A\) 。 Cayle 阅读全文
posted @ 2021-08-02 00:44 Dayu2001 阅读(146) 评论(0) 推荐(0)
摘要: 队伍:新建文本文档 来源:2020-2021 ICPC - Gran Premio de Mexico - Repechaje - I. Integers Rectangle Challenge 题意 给定 \(N\times M\) 矩阵,第 \(i\) 行第 \(j\) 列的数为 \(R_{i, 阅读全文
posted @ 2021-03-16 21:19 Dayu2001 阅读(248) 评论(0) 推荐(0)
摘要: 链接 Rating. 题解 A. Strange Functions 结论。 观察数据猜结论,输出 \(n\) 的数位长度即可。 B. Jumps 递推。 设 \(f(i)\) 表示生成 \(i\) 的最小步数。显然,当 \(i = \frac{x(x+1)}{2}\) 时, \(f(i) = x\ 阅读全文
posted @ 2020-12-01 02:08 Dayu2001 阅读(66) 评论(0) 推荐(0)
摘要: 配置传统题型 输入数据生成 以 a + b Problem,生成 10 组数据,为例。 int a, b; FILE *fp; char filename[50]; for(int t = 1; t <= 10; ++i) { sprintf(filename, "aaa%d.in", t); fp 阅读全文
posted @ 2020-10-30 16:33 Dayu2001 阅读(67) 评论(0) 推荐(0)
摘要: 链接 Virtual participation A. Suborrays 观察发现任何排列均满足题意。 #include<bits/stdc++.h> using namespace std; int N; int main(){ ios::sync_with_stdio(0); cin.tie( 阅读全文
posted @ 2020-10-08 11:30 Dayu2001 阅读(110) 评论(0) 推荐(0)
摘要: 链接 Virtual participation A. Boboniu Likes to Color Balls 分类讨论。 观察到能否组成回文与每种球的奇偶性有关,分类讨论即可,CF传统题型了。注意球数为0的情况。 #include<cstdio> #include<cstring> #inclu 阅读全文
posted @ 2020-09-30 18:35 Dayu2001 阅读(124) 评论(0) 推荐(0)