标签:iss image padding 整数 rip blog 题目 panel font
1 5 7 3 8 8 1 0 2 7 4 4 4 5 2 6 5
30
#include <iostream> #include <vector> using namespace std; #define limit 101 #define Max(a,b) ((a) > (b) ? (a) : (b)) long a[limit][limit]; long max(long l1, long l2) { return l1 > l2 ? l1 : l2; } int main() { int T,n; cin >> T; while (T--) { cin >> n; for (int i = 1; i <= n; i++) { for (int j = 1; j <= i; j++) cin >> a[i][j]; } for (int i = n-1; i >=1; i--) { for (int j = 1; j <= n-1; j++) { a[i][j] += Max(a[i + 1][j], a[i + 1][j + 1]); } } cout << a[1][1] << endl; } return 0; }
标签:iss image padding 整数 rip blog 题目 panel font
原文地址:http://www.cnblogs.com/theskulls/p/6192711.html