求助

B2144 阿克曼(Ackermann)函数

@[mlemtion](/user/946696) 数据弱了
by liverxiwo @ 2024-03-27 13:57:22


akm增长快,大数据要FFT加速,那知识点是十级的。。。。
by liverxiwo @ 2024-03-27 13:58:26


@[mlemtion](/user/946696) 可以不用数组 ~~也可以不用long long~~ ``` #include <iostream> using namespace std; long long akm(int m,int n) { if(m==0) { return n+1; } if(n==0) { return akm(m-1,1); } return akm(m-1,akm(m,n-1)); } int main() { int n,m; cin >> n >> m; cout << akm(n,m); return 0; } ```
by kongjunwen @ 2024-05-15 20:51:16


祝早日**AC**!
by kongjunwen @ 2024-05-15 20:51:51


|