每种水的生成函数
第1种:
第2种:
第3种:
第4种:
第5种:
乘在一起得到:
带入广义二项式定理得:
当时第项为
所以答案就为
1 2 3 4 5 6 7 8 9 10 11 12
| #include <iostream> #include <cstdio> #include <cstring> #include <algorithm> using namespace std; int main(void) { int n; scanf("%d",&n); printf("%lld\n",1LL*(n+1)*(n+2)/2); return 0; }
|
Gitalking ...