摘要:
题意:给出两个数,n,m,问1~m中的数组成n,有多少种方法? 这题其实就相当于 UVA 674 Coin Change,求解一样 只不过数据很大,需要用到高精度运算。。。后来还看了网上别人的解法,是将大数转化成高位和低位两部分处理代码一:用数组存储数据的每个位#include #include #include #include using namespace std;const int maxn=1005;long long dp[maxn][41]; //增加一维存储每一位的数int n,k;int main() { while(scanf("%d%d",&n 阅读全文
posted @ 2013-12-08 16:27
辰曦~文若
阅读(259)
评论(0)
推荐(0)
摘要:
题意:有n个(n#include #include #include using namespace std;const int INF=0x3f3f3f3f;const int maxn=(1=s[i];j--){ if((s[i]|j)==j){ dp[j]=min(dp[j],dp[j-s[i]]+1); } } } printf("Scenario #%d:\n",q); printf("%d\n\n",dp[(1#inclu... 阅读全文
posted @ 2013-12-08 09:36
辰曦~文若
阅读(271)
评论(0)
推荐(0)

浙公网安备 33010602011771号