好好改
我也不会
加油!!!!!!!!
by Tacmon @ 2017-09-02 21:38:57
@[王荣航2018](/space/show?uid=54753) 你来改一改
by 时光刺客 @ 2017-09-02 21:49:12
敝敝鄙鄙人人人人只有一点:
您你您您可否用一用w[ ][ ][ ];
和二维数组没多大区别的
by Tacmon @ 2017-09-02 22:00:11
好好看下格式
by zirrtu @ 2017-09-13 13:20:44
认同
by Tacmon @ 2017-09-14 20:28:03
```cpp
#include<cstdio>
#include<cstring>
typedef long long ll;
ll s[30][30][30]={0};
ll w(ll a,ll b,ll c)
{
if(a<=0||b<=0||c<=0) return 1;
if(a>20||b>20||c>20) return w(20,20,20);
if(s[a][b][c]!=-1) return s[a][b][c];
else s[a][b][c]=(a<b&&b<c)?(w(a,b,c-1)+w(a,b-1,c-1)-w(a,b-1,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));
}
int main()
{
ll a,b,c;
memset(s,-1,sizeof(s));
while(1)
{
scanf("%lld %lld %lld",&a,&b,&c);
if(a==-1&&b==-1&&c==-1) break;
printf("w(%lld, %lld, %lld) = %lld\n",a,b,c,w(a,b,c));
}
return 0;
}
```
by Explorer_CYC @ 2017-12-14 13:12:15