标签:bottom other describe roc ada tor multi ima note
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)
Total Submission(s): 39292 Accepted Submission(s): 18054
Output
#include <iostream> #include <algorithm> #include <cstring> #include <cstdio> #include <vector> #include <iomanip> #include <cmath> #include <ctime> #include <map> #include <set> using namespace std; #define lowbit(x) (x&(-x)) #define max(x,y) (x>y?x:y) #define min(x,y) (x<y?x:y) #define MAX 100000000000000000 #define MOD 1000000007 #define pi acos(-1.0) #define ei exp(1) #define PI 3.141592653589793238462 #define INF 0x3f3f3f3f3f #define mem(a) (memset(a,0,sizeof(a))) typedef long long ll; int dp[1006],a[1006],n; int main() { while(scanf("%d",&n) && n) { int maxn=-1,ans=0,top=0; memset(dp,0,sizeof(dp)); for(int i=0;i<n;i++) { scanf("%d",&a[i]); dp[i]=a[i]; } for(int i=0;i<n;i++) { for(int j=0;j<i;j++) { if(a[i]>a[j]) dp[i]=max(dp[i],dp[j]+a[i]); } maxn=max(dp[i],maxn); } printf("%d\n",maxn); } return 0; }
HDU 1087 Super Jumping! Jumping! Jumping!
标签:bottom other describe roc ada tor multi ima note
原文地址:http://www.cnblogs.com/shinianhuanniyijuhaojiubujian/p/7230902.html