
----组合数学
文章平均质量分 50
sega_handsome
这个作者很懒,什么都没留下…
展开
-
FZU 2282 Wand(错排+费马小定理)
题意 : 给你n个人, k 个数, 任意交换n个人的顺序,1号还在一号位就表示它的位置是对的. 则问你至少k个人还在对的位置的方案有几种. 关于错排的解释:解释: n 个不同元素的一个错排可由下述两个步骤完成: 第一步,“错排” 1 号元素(将 1 号元素排在第 2 至第 n 个位置之一),有 n - 1 种方法。 第二步,“错排”其余 n - 1 个元素,按如下顺序进行。视第一步的结果原创 2017-08-18 21:32:53 · 241 阅读 · 0 评论 -
Codeforces Round #439 (Div. 2) C The Intriguing Obsession (组合数学)
别人的代码; Problem C Consider islands of two colours and the bridges between them. #include #include using namespace std; #define mod 998244353 #define maxn 5010 int C[maxn][maxn]; long long jie[maxn原创 2017-10-07 10:05:14 · 279 阅读 · 0 评论 -
Baby's Blocks Gym - 101518D 组合排列
参考:https://vjudge.net/problem/Gym-101518DD. Baby’s Blocks Mikey is playing with his favorite toy blocks, each depicting one letter of the alphabet. He is trying to make words using all his blocks, bu原创 2017-11-29 15:32:32 · 137 阅读 · 0 评论 -
Educational Codeforces Round 28 F. Random Query 期望(贡献思想)
官方题解。。 846F - Random Query For each index i we will find the number of pairs (l, r) (before swapping) such that i is the first occurence of ai in the chosen segment. Let f(i) be previous occurence o转载 2017-09-06 22:31:36 · 410 阅读 · 0 评论