标签:des style blog http io ar color sp for
1 #include<stdio.h> 2 #include<stdlib.h> 3 #include<string.h> 4 #define MAX 105 5 6 int main(void) 7 { 8 int c,n; 9 int dp[MAX][MAX]; 10 11 scanf("%d",&c); 12 while(c --) 13 { 14 scanf("%d",&n); 15 for(int i = 1;i <= n;i ++) 16 for(int j = 1;j <= i;j ++) 17 scanf("%d",&dp[i][j]); 18 19 for(int i = n - 1;i >= 1;i --) 20 for(int j = 1;j <= i;j ++) 21 dp[i][j] += dp[i + 1][j] > dp[i + 1][j + 1] ? dp[i + 1][j] : dp[i + 1][j + 1]; 22 printf("%d\n",dp[1][1]); 23 } 24 25 return 0; 26 }
标签:des style blog http io ar color sp for
原文地址:http://www.cnblogs.com/xz816111/p/4161682.html