标签:
Filthy Rich
Time Limit:5000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64u
Description
Input
Output
Sample Input
Sample Output
Analysis
1 #include <cstdio> 2 #include <cstring> 3 #include <algorithm> 4 5 using namespace std; 6 7 int map[1005][1005]; 8 9 int main() 10 { 11 int t; 12 scanf("%d",&t); 13 for(int i=1;i<=t;i++) 14 { 15 memset(map,0,sizeof(map)); 16 int r,c; 17 scanf("%d%d",&r,&c); 18 for(int j=1;j<=r;j++) 19 for(int k=1;k<=c;k++) 20 { 21 scanf("%d",&map[j][k]); 22 map[j][k] += max(map[j-1][k],map[j][k-1]); 23 } 24 printf("Scenario #%d:\n%d\n\n",i,map[r][c]); 25 } 26 return 0; 27 }
标签:
原文地址:http://www.cnblogs.com/GY8023/p/4693785.html