标签:
原题:
Description
Input
Output
Sample Input
Sample Output
#include<iostream> #include<cstdio> using namespace std; int f[110][110]; int main() { f[1][1] = 1; for (int i =2; i < 110; i++) { f[1][i] = f[1][i - 1] + i; f[i][1] = f[i - 1][1] + i; } for (int i = 2; i < 110; i++) { for (int j = 2; j < 110; j++) { f[i][j] = f[i][1] * f[1][j]; } } int t; cin >> t; while (t--) { int n, m; cin >> n >> m; cout << f[n][m] << endl; } return 0; }
标签:
原文地址:http://www.cnblogs.com/shawn-ji/p/4696565.html