题意:1-n个位置中,每个位置填一个数,问至少有l个数是相同的概率. 可以转化求最多有l-1个数是相同的. dp[i][j]表示前i个位置填充j个位置的方案数,并且要满足上面的条件. 则: dp[i][j]=∑dp[i-1][j-k]*c[m-j+k][k]; 也就是看第i个数,可以不填,填一个位置,两个位置······这样累加过来. 代码如下: import java.math.*; import java.util.*; public class Main { public static v…
Board Game time limit per test 2.5 seconds memory limit per test 256 megabytes input standard input output standard output You are playing a board card game. In this game the player has two characteristics, x and y — the white magic skill and the bla…
Exchange Cards Time Limit: 2 Seconds Memory Limit: 65536 KB As a basketball fan, Mike is also fond of collecting basketball player cards. But as a student, he can not always get the money to buy new cards, so sometimes he will exchange with his…