# 希望更丰富的展现?使用Markdown
by Victorique_De_Blois @ 2018-11-29 17:39:11
它让你递归你就真递归啊
by NaCly_Fish @ 2018-11-29 17:41:20
@[NaCly_Fish](/space/show?uid=115864) 抱歉看错了,还是用了记忆化的
by NaCly_Fish @ 2018-11-29 17:42:32
@[NaCly_Fish](/space/show?uid=115864) 我用记忆化了呀。。
by 会飞的禽兽 @ 2018-11-29 17:42:51
@[会飞的禽兽](/space/show?uid=13702) 希望更丰富的展现?使用Markdown
请注意格式问题(输出的w括号里有空格)
by sss7020 @ 2018-11-29 17:50:41
@[Jack_killer](/space/show?uid=110593) 不。。。不会用呀。。。
by 会飞的禽兽 @ 2018-11-29 17:54:02
@[陈博文1412](/space/show?uid=84626) 加空格了
by 会飞的禽兽 @ 2018-11-29 17:54:14
[评测记录](https://www.luogu.org/record/show?rid=14239458)
by ⚡小林孑⚡ @ 2018-11-29 17:54:16
```cpp
#include<iostream>
#include<cstdio>
#include<cstring>
using namespace std;
long long ans[30][30][30]={0,0,0};
int w(int a,int b,int c)
{ //cout<<"w(a,b,c)="<<a<<" "<<b<<" "<<c<<endl;
if (a<=0||b<=0||c<=0) return 1;
if (ans[a][b][c]!=0) return ans[a][b][c];
if (a<b&&b<c) {
ans[a][b][c]=w(a,b,c-1)+w(a,b-1,c-1)+w(a,b-1,c);
return ans[a][b][c]; } ans[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); return ans[a][b][c];
}
int main() {
long long a,b,c;
memset(ans,0,sizeof(ans));
while (cin>>a>>b>>c) {
if (a==-1&&b==-1&&c==-1) break;
printf("w(%lld, %lld, %lld) = ",a,b,c);
if (a>20||b>20||c>20) a=b=c=20;
int aaa=w(a,b,c); printf("%d\n",aaa);} return 0; }
```
by ⚡小林孑⚡ @ 2018-11-29 17:56:34
@[会飞的禽兽](/space/show?uid=13702) 函数开long long ans数组开小了
by ⚡小林孑⚡ @ 2018-11-29 18:01:32