| Run ID | Author | Problem | Lang | Verdict | Time | Memory | Code Length | Submit Time |
|---|---|---|---|---|---|---|---|---|
| 14395 | hu | 移动路线 | C++ | Accepted | 0 MS | 252 KB | 447 | 2023-04-14 10:52:01 |
#include<bits/stdc++.h> using namespace std; int a[20][20]; int f(int m, int n) { if(a[m][n] != 0) return a[m][n]; if(m == 1 || n == 1) { return a[m][n] = 1; } return a[m][n] = f(m - 1, n) + f(m, n - 1); } int main() { int m, n; cin >> m >> n; cout << f(m, n) << endl; // for (int i = m; i >= 1; i--) { // for (int j = 1; j <= n; j++) { // printf("%5d", a[i][j]); // } // cout << endl; // } return 0; }