求助,1AC4WA

P1464 Function

``` #include<iostream> using namespace std; long long a,b,c; long long x[50][50][50]={0}; long long w(long long d,long long e,long long f) { if(d<=0||e<=0||f<=0) return 1; if(d>20||e>20||f>20) return w(20,20,20); if(x[d][e][f]!=0)return x[d][e][f]; if(d<e&&e<f) { x[d][e][f]= w(d,e,f-1)+w(d,e-1,f-1)-w(d,e-1,f); return x[d][e][f]; } x[d][e][f]= w(d-1,e,f)+w(d-1,e-1,f)+w(d-1,e,f-1)-w(d-1,e-1,f-1); return x[d][e][f]; } int main () { while(a!=-1||b!=-1||c!=-1) { cin>>a>>b>>c; if(a!=-1||b!=-1||c!=-1) cout<<"w("<<a<<", "<<b<<", "<<c<<") = "<<w(a,b,c)<<endl; } return 0; } ```
by lndjy @ 2020-01-04 10:05:04


@[zxy1703](/user/305553) 自己看吧,我太菜不帮你改了
by lndjy @ 2020-01-04 10:06:59


@[水题淹死的鱼](/user/196899) orz跪谢神犇
by zxy1703 @ 2020-01-04 10:44:48


@[zxy1703](/user/305553) 我明明是蒟蒻qwq
by lndjy @ 2020-01-04 15:47:25


|