摘要:
View Code 1 #include"iostream" 2 using namespace std; 3 int main() 4 { 5 int a,b,c; 6 int sum; 7 while(cin>>a>>b>>c,a+b+c) 8 { 9 if(a==0) sum=1;10 if(b==0&&a) 11 {12 if(c==0) sum=a+1;13 else if(c)14 {15 if(a<4) sum=a+1;16 else sum=a+5*c+1;17 }18 }19 if(a*b& 阅读全文
posted @ 2011-03-23 10:02
聊聊IT那些事
阅读(291)
评论(0)
推荐(0)
摘要:
http://acm.hdu.edu.cn/showproblem.php?pid=1087View Code //dp问题:// 状态转移方程 b[i]=max(b[i], b[j]+a[i]);#include"iostream"using namespace std;#define M 1010int n;int a[M],b[M];int i,j;int main(){ while(cin>>n,n) { int Max=-0xffff; memset(b,0,sizeof(0)); for(i=0;i<n;i++) cin>>a[i] 阅读全文
posted @ 2011-03-23 09:08
聊聊IT那些事
阅读(537)
评论(0)
推荐(0)