UVa 10446 求(n,bcak)递归次数.自己推出来了一个式子: 其实就是这个式子,但是不知道该怎么写,怕递归写法超时.其实直接递推就好,边界条件易得C(0,back)=1.C(1,back)=1. Reference Code: #include<iostream> #include<cstdio> using namespace std; typedef unsigned long long ll; ll dp[][]={}; int main() { int n,bac…
有n张牌,求出至少有k张牌连续是正面的排列的种数.(1=<k<=n<=100) Toss is an important part of any event. When everything becomes equal toss is the ultimate decider. Normally a fair coin is used for Toss. A coin has two sides head(H) and tail(T). Superstition may work in…
GRAVITATION, n.“The tendency of all bodies to approach one another with a strengthproportion to the quantity of matter they contain – the quantity ofmatter they contain being ascertained by the strength of their tendencyto approach one another. This…
除了根节点以外,有n-1个节点,然后就看n-1的因数有那些,所有因数加起来(递推)就好了. #include<cstdio> #define REP(i, a, b) for(int i = (a); i < (b); i++) using namespace std; const int MOD = 1e9 + 7; const int MAXN = 1123; int ans[MAXN]; void init() { ans[1] = 1; REP(i, 2, MAXN) REP(j…