IT民工
加油!
摘要: http://www.rqnoj.cn/Problem_6.html#include<cstdio>#include<algorithm>#include<cstring>using namespace std;const int MAXN = 32100;const int MAXM = 65;int f[MAXM][MAXN];int c[MAXM][3], w[MAXM][3];int n, m;void Pack(){ int i, j; for( i = 1; i <= m; i ++) for( int j = 0; j <= n; 阅读全文
posted @ 2012-07-19 18:29 找回失去的 阅读(143) 评论(0) 推荐(0) 编辑
摘要: 被虐得很惨的一道题,WA了无数次,根据题意推出C*x+(2^k)*y=B-A,用拓展欧几里德求出x的最小值。如果无解则是死循环!/*Accepted 164K 0MS C++ 882B 2012-07-19 12:03:12*/#include<cstdio>#include<cstring>#include<cstdlib>#define LL long longLL extgcd( LL a, LL b, LL &x, LL &y){ if( b == 0) { x = 1; y = 0; return a;} LL d = extgcd 阅读全文
posted @ 2012-07-19 12:10 找回失去的 阅读(195) 评论(0) 推荐(0) 编辑