题意: n个数(1~n)取出r个数,取出的数相差要>=k, 然后分成m个可空组,问有多少种情况. 解法: 先看从n个数中取r个相差>=k的数的方法数,可以发现 dp[i][j] = dp[1][j-1] + dp[2][j-1] + ... + dp[i-k][j-1],(dp[i][1] = i)  即维护一个前缀和即可,可以在O(r*n)内得出. 然后n个不同的数分成m个可以空的组,即为第二类Strling数的和 : S[n][1] + S[n][2] + ... + S[n][m]. S…
Machine scheduling Time Limit: 5000/2000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 1000    Accepted Submission(s): 363 Problem Description A Baidu's engineer needs to analyze and process large amount of data o…
传送门 Machine scheduling Time Limit: 5000/2000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 1048    Accepted Submission(s): 387 Problem Description A Baidu’s engineer needs to analyze and process large amount of dat…
这个问题似乎有很多种求法,但感觉上第二类Strling数的做法是最方便的. 问题 求下面这个式子: ∑i=0nik\sum_{i=0}^n i^ki=0∑n​ik nnn的范围可以很大. 第二类Strling数 第二类Strling数记作S(n,m)S(n,m)S(n,m).SnmS_n^mSnm​. 定义:将nnn个相同的球放在mmm个不同的箱子里的方案数(其中的每一个箱子至少有一个球). 很容易推出一个式子:Snm=Sn−1m−1+mSn−1mS_n^m=S_{n-1}^{m-1}+mS_{…
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2643 题意: 有n个个选手参赛,问排名有多少种情况(可以并列). 题解: 简化问题: 将n个不同的元素放到i个有差别的盒子中,情况数为P(n,i),求∑P(n,i) (1<=i<=n) 再简化: 将n个不同的元素放到i个无差别的盒子中,情况数为S(n,i),求∑( S(n,i)*i! ) (1<=i<=n) 哇这是第二类Stirling数 ( ̄▽ ̄)~* 递推式:s(n,k) = s(…
题目链接:https://vjudge.net/problem/HDU-4045 Machine scheduling Time Limit: 5000/2000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 1907    Accepted Submission(s): 702 Problem Description A Baidu’s engineer needs to an…
Machine scheduling Time Limit : 5000/2000ms (Java/Other)   Memory Limit : 32768/32768K (Java/Other) Total Submission(s) : 4   Accepted Submission(s) : 1 Font: Times New Roman | Verdana | Georgia Font Size: ← → Problem Description A Baidu’s engineer n…
Machine Schedule Time Limit: 1 Sec  Memory Limit: 256 MB 题目连接 http://acm.hdu.edu.cn/showproblem.php?pid=1150 Description As we all know, machine scheduling is a very classical problem in computer science and has been studied for a very long history.…
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1150 Machine Schedule Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 6733    Accepted Submission(s): 3375 Problem Description As we all know, mach…
Problem Description As we all know, machine scheduling is a very classical problem in computer science and has been studied for a very long history. Scheduling problems differ widely in the nature of the constraints that must be satisfied and the typ…