题目连接:357 - Let Me Count The Ways 题目大意:有5种硬币, 面值分别为1.5.10.25.50,现在给出金额,问可以用多少种方式组成该面值. 解题思路:和uva674是一样的, 只是上限不一样, 还有注意下输出. #include <stdio.h> #include <string.h> const int N = 30005; const int val[5] = {1, 5, 10, 25, 50}; long long cnt[N]; void…
Count the Trees Another common social inability is known as ACM (Abnormally Compulsive Meditation). This psychological disorder is somewhat common among programmers. It can be described as the temporary (although frequent) loss of the faculty of sp…
思路: 容斥. 实现: #include <bits/stdc++.h> using namespace std; typedef long long ll; ; ; ll f[MAXN + ], inv[MAXN + ]; ll pow(ll a, ll b) { ll res = ; while (b) { ) res = res * a % MOD; b >>= ; a = a * a % MOD; } return res; } void init() { f[] = ;…