这题告诉我们数组尽可能开大
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <cstring>
#include <ctime>
#include <cmath>
#define mxn 11+100000
#define mxm 3+2
using namespace std;
int n,m;
int A[mxm][mxn];
int ack(int m,int n)
{
//printf(" m: %d n: %d\n",m,n);
if (m==0) return n+1;
if (A[m][n]>0) return A[m][n];
if (n==0) A[m][n]=ack(m-1,1);
else A[m][n]=ack(m-1,ack(m,n-1));
return A[m][n];
}
int main()
{
freopen("ackerman.in","r",stdin);
freopen("ackerman.out","w",stdout);
memset(A,0,sizeof(A));
scanf("%d%d",&m,&n);
printf("%d",ack(m,n));
return 0;
}