摘要: 题意:从n个男孩中挑出k个,每个人有两个属性u,v怎样挑选能得到最大的value定义状态:dp[ i ][ j ]:从前i个中挑出j个得到的最大value对于第i个,若选择,dp[i][j]=dp[i-1][j-1]+a[i].u-a[i].v*(j-1) 若不选择,dp[i][j]=dp[i-1][j]+0;View Code 1 #include<algorithm> 2 #include<stdlib.h> 3 #include<string.h> 4 #include<stdio.h> 5 using namespace std; 6 c 阅读全文
posted @ 2013-02-09 23:07 xxx0624 阅读(310) 评论(0) 推荐(0) 编辑
摘要: 推理一个数字含有一个5就能有一个0,但是在计数的时候要除去这个5,再去进行新的计算。View Code 1 #include<stdio.h> 2 #include<string.h> 3 #include<math.h> 4 typedef __int64 int64; 5 int main(){ 6 int t; 7 scanf("%d",&t); 8 while( t-- ){ 9 int64 n;10 scanf("%I64d",&n);11 int64 ans=0;12 int64 now=5 阅读全文
posted @ 2013-02-09 21:20 xxx0624 阅读(299) 评论(0) 推荐(0) 编辑