Description "Well, it seems the first problem is too easy. I will let you know how foolish you are later." feng5166 says. "The second problem is, given an positive integer N, we define an equation like this:   N=a[1]+a[2]+a[3]+...+a[m];   a…
Ignatius and the Princess Description        "Well, it seems the first problem is too easy. I will let you know how foolish you are later." feng5166 says.        "The second problem is, given an positive integer N, we define an equation lik…
http://www.51nod.com/onlineJudge/questionCode.html#!problemId=1770 这是这次BSG白山极客挑战赛的B题.设p(i, j)表示节点个数为i,高度为j的AVL树的个数. 那么,对于1 <= k <= i-1 p[i][j] += p[k][j-1]*p[i-1-k][j-1]%MOD; p[i][j] += p[k][j-2]*p[i-1-k][j-1]%MOD; p[i][j] += p[k][j-1]*p[i-1-k][j-2]…
Description Assuming a finite – radius “ball” which is on an N dimension is cut with a “knife” of N-1 dimension. How many pieces will the “ball” be cut into most?However, it’s impossible to understand the following statement without any explanation.L…
Description Golden ratio base (GRB) is a non-integer positional numeral system that uses the golden ratio (the irrational number (1+√5)/2 ≍ 1.61803399 symbolized by the Greek letter φ) as its base. It is sometimes referred to as base-φ, golden mean b…
Ignatius and the Princess III Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 11810    Accepted Submission(s): 8362 Problem Description "Well, it seems the first problem is too easy. I will let…
Ignatius and the Princess III Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 12521    Accepted Submission(s): 8838 Problem Description "Well, it seems the first problem is too easy. I will let…
Ignatius and the Princess III Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 25805    Accepted Submission(s): 17839 Problem Description "Well, it seems the first problem is too easy. I will let…
这是道典型的母函数的题目,可以看看我的母函数这一标签上的另一道例题,里面对母函数做了较为详细的总结.这题仅贴上代码: #include"iostream" using namespace std; #define N 130 ],b[N+]; int main() { int n,i,j,k; ) { ;i<=n;i++) {a[i]=;b[i]=;} ;i<=n;i++) { ;j<=n;j++) ;k+j<=n;k+=i) { b[k+j]+=a[j]; }…
题意 给出$n$,问用$1$到$n$的数字问能构成$n$的方案数 思路 生成函数基础题,$x^{n}$的系数即答案. 代码 #include <bits/stdc++.h> #define DBG(x) cerr << #x << " = " << x << endl; using namespace std; const int N = 120 + 5; int n, c[2][N]; int main() { while(…