Type: Default 2000ms 256MiB

递归函数

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.

题目描述

考虑如下的3参数递归函数w(a,b,c);

如果a≤0或b≤0或c≤0,则w(a,b,c)=1;

如果a>20或b>20或c>20,则w(a,b,c)=w(20,20,20);

如果其他情况下:w(a,b,c)=w(a-1,b,c)+w(a-1,b-1,c)+w(a-1,b,c-1)-w(a-1, b-1,c-1)。

设计一个程序,快速计算w(a,b,c)并给出结果。

输入格式

1行整数,包含3个数值,分别对应a、b和c的值。

输出格式

一个数,即w(a,b,c)的结果。

样例

input

50 50 50

output

1048576

限制与提示

时间限制:1s1 \text {s}

空间限制:256MB256 \text {MB}

2025-11-16周训练

Not Attended
Status
Done
Rule
XCPC
Problem
7
Start at
2025-11-16 14:15
End at
2025-11-16 17:15
Duration
3 hour(s)
Host
Partic.
26