Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
112760 小徐老师 阿克曼函数 C++ Accepted 157 MS 396 KB 333 2025-03-11 20:00:18

Tests(10/10):


Code:

#include <bits/stdc++.h> using namespace std; int f(int m, int n) { if(m == 0) return n + 1; if(m > 0 && n == 0) return f(m - 1, 1); if(m > 0 && n > 0) return f(m - 1, f(m, n - 1)); } int main() { int m, n; cin >> m >> n; cout << f(m, n) << '\n'; return 0; }