组合数
lqybzx
123
展开
-
bzoj 1856: [Scoi2010]字符串
Description lxhgww最近接到了一个生成字符串的任务,任务需要他把n个1和m个0组成字符串,但是任务还要求在组成的字符串中,在任意的前k个字符中,1的个数不能少于0的个数。现在lxhgww想要知道满足要求的字符串共有多少个,聪明的程序员们,你们能帮助他吗? Input 输入数据是一行,包括2个数字n和m Output 输出数据是一行,包括1个数字,表示满足要求的原创 2015-01-06 23:25:45 · 723 阅读 · 0 评论 -
bzoj 4517: [Sdoi2016]排列计数
Description 求有多少种长度为 n 的序列 A,满足以下条件: 1 ~ n 这 n 个数在序列中各出现了一次 若第 i 个数 A[i] 的值为 i,则称 i 是稳定的。序列恰好有 m 个数是稳定的 满足条件的序列可能很多,序列数对 10^9+7 取模。 Input 第一行一个数 T,表示有 T 组数据。 接下来 T 行,每行两个整数 n、m。 T=500000原创 2016-06-14 23:44:34 · 253 阅读 · 0 评论 -
2016多校训练Contest6: 1002 A Simple Chess hdu5794
Problem Description 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 position (x1,y1), only an原创 2016-08-04 23:53:27 · 848 阅读 · 1 评论 -
codeforces689E: Mike and Geometry Problem
Description Mike wants to prepare for IMO but he doesn't know geometry, so his teacher gave him an interesting geometry problem. Let's definef([l, r]) = r - l + 1 to be the number of integer poin原创 2016-08-01 22:18:19 · 573 阅读 · 0 评论 -
codeforces439E: Devu and Birthday Celebration
Description Today is Devu's birthday. For celebrating the occasion, he bought n sweets from the nearby market. He has invited his f friends. He would like to distribute the sweets among them. As原创 2016-08-01 22:21:26 · 565 阅读 · 0 评论 -
2016多校训练Contest6: 1001 A Boring Question hdu5793
Problem Description There are an equation. ∑0≤k1,k2,⋯km≤n∏1⩽jm(kj+1kj)%1000000007=? We define that (kj+1kj)=kj+1!kj!(kj+1−kj)! . And (kj+1kj)=0 while kj+1kj. You have to get the answer for eac原创 2016-08-05 17:21:31 · 538 阅读 · 0 评论 -
2016多校训练Contest7: 1002 Hearthstone hdu5810
Problem Description Mr. Chopsticks is interested in random phenomena, and he conducts an experiment to study randomness. In the experiment, he throws n balls into m boxes in such a manner that each原创 2016-08-09 21:41:41 · 392 阅读 · 0 评论