标签:mon arc out des pac mod print 分析 amp
Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 41852 Accepted Submission(s): 24820
1 #include<stdio.h> 2 int main() 3 { 4 int C,i,j,N; 5 int a[101][101]; 6 while(scanf("%d",&C)==1) 7 { 8 while(C--) 9 { 10 scanf("%d",&N); 11 for(i=0;i<N;i++) 12 for(j=0;j<=i;j++) 13 scanf("%d",&a[i][j]); 14 for(i=N-1;i>=0;i--) 15 { 16 for(j=0;j<=i;j++) 17 { 18 if(a[i][j]+a[i-1][j]>a[i][j+1]+a[i-1][j]) 19 a[i-1][j]=a[i][j]+a[i-1][j]; 20 else 21 a[i-1][j]=a[i][j+1]+a[i-1][j]; 22 } 23 } 24 printf("%d\n",a[0][0]); 25 } 26 } 27 return 0; 28 }
标签:mon arc out des pac mod print 分析 amp
原文地址:http://www.cnblogs.com/ECJTUACM-873284962/p/6582803.html