摘要:View Code 1 /* 2 dp[i][0] i位数字的数首位为0 3 dp[i][1] i位数字的数首位为1 4 5 */ 6 #include<stdio.h> 7 int main() 8 { 9 int n,k;10 int dp[20][2];11 while(~scanf("%d%d",&n,&k))12 {13 dp[1][0]=1; //只有一个数字的数首位为0那就只有0一个数 14 dp[1][1]=k-1;//只有一个数字的数首位不为0 ,对于k进制就只有k-1个数,除掉0嘛 15 ...
阅读全文
摘要:http://acm.hdu.edu.cn/showproblem.php?pid=1171View Code 1 #include<stdio.h> 2 #include<string.h> 3 #define max(x,y) x>y?x:y 4 int main() 5 { 6 int n; 7 int m; 8 int sum; 9 int i,j,jj;10 int a[55];11 int w[5500];12 int f[250000];13 while(~scanf("%d",&n)&&n>0)14
阅读全文
摘要:http://acm.hdu.edu.cn/showproblem.php?pid=1081题意:求子矩阵的和的最大值思路:把多维转化为一维,只要会一维的就简单了。。。To The MaxTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 4842Accepted Submission(s): 2289Problem DescriptionGiven a two-dimensional array of positive and negative
阅读全文
摘要:http://acm.hdu.edu.cn/showproblem.php?pid=1159Common SubsequenceTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 13271Accepted Submission(s): 5454Problem DescriptionA subsequence of a given sequence is the given sequence with some elements (possible
阅读全文