传统题 1000ms 128MiB

Ackman函数

You cannot submit for this problem because the contest is ended. You can click "Open in Problem Set" to view this problem in normal mode.

题目描述

Ackman函数的定义如下

$$\text{ack}(m,n)= \left\{ \begin{aligned} n+1 & & {m=0} \\ \text{ack}(m-1,1) & & {n=0} \\ \text{ack}(m-1,\text{ack}(m,n-1) & & {\text{otherwise}} \end{aligned} \right. $$

输入格式

一行包含两个正整数 m,nm,n

输出格式

ack(m,n)\text{ack}(m,n)

2 5
13

数据范围

0m,n50 \le m,n \le 5

递归

未认领
状态
已结束
题目
10
开始时间
2026-7-6 0:00
截止时间
2026-7-31 23:59
可延期
24 小时