摘要: 貌似跟1171一样的,呃。。。My Code:#include <iostream>#include <cstring>#include <cstdio>using namespace std;const int N = 100;struct node { int val; int num;} a[55];int c1[N], c2[N];int main() { //freopen("data.in", "r", stdin); int t, n, i, j, sum, k, m; while(cin >> 阅读全文
posted @ 2011-11-24 17:07 AC_Von 阅读(254) 评论(0) 推荐(0) 编辑
摘要: 比1085多了一些变化,见代码。My Code:#include <iostream>#include <cstring>#include <cstdio>using namespace std;const int N = 250007;struct node { int val; int num;} a[55];int c1[N], c2[N];int main() { //freopen("data.in", "r", stdin); int n, i, j, sum, k; while(cin >> 阅读全文
posted @ 2011-11-24 16:43 AC_Von 阅读(209) 评论(0) 推荐(0) 编辑
摘要: /*按照母函数的思路,然后模拟三个括号相乘的过程。因为题目已经限定好了硬币只能是1、2、5。所以可以写成:(1 + X + X^2 + ...)(1 + X^2 + X^4 + X^6 + ...)(1 + X^5 + X^10 + X^15 + ...)其中三个括号元素的个数分别是输入的num_1, num_2, num_3。然后就是模拟多项式相乘了。*///ps:代码有点水,一步一步乘的,反正就三个括号,费不了多大劲,^_^//My Code:#include <iostream>#include <cstring>#include <cstdio>us 阅读全文
posted @ 2011-11-24 15:34 AC_Von 阅读(222) 评论(0) 推荐(0) 编辑
摘要: 母函数模板题,就是稍微改了一下。My Code:#include <iostream>#include <cstring>#include <cstdio>using namespace std;const int N = 307;int c1[N], c2[N];int main() { //freopen("data.in", "r", stdin); int n, i, j, k; while(cin >> n, n) { for(i = 0; i <= n; i++) { c1[i] = 1; 阅读全文
posted @ 2011-11-24 14:26 AC_Von 阅读(184) 评论(0) 推荐(0) 编辑