希望更丰富的展现?使用Markdown
by ezoixx130 @ 2018-09-18 20:10:30
```
include<bits/stdc++.h>
using namespace std;
long long a[10000],b[10000],c[10000]; long long dp[30][30][30]; int k; int w(int x,int y,int z) { if(x<=0||y<=0||z<=0) return 1; else if(dp[x][y][z]!=0) return dp[x][y][z]; else if(x>20||y>20||z>20) dp[x][y][z]=w(20,20,20); else if(x<y&&y<z) dp[x][y][z]=w(x,y,z-1)+w(x,y-1,z-1)-w(x,y-1,z); else dp[x][y][z]=w(x-1,y,z)+w(x-1,y-1,z)+w(x-1,y,z-1)-w(x-1,y-1,z-1); return dp[x][y][z]; } int main() { for(long long i=0;i<10000;i++) {
k=i; cin>>a[i]>>b[i]>>c[i]; if(a[i]==-1&&b[i]==-1&&c[i]==-1) break; } for(long long i=0;i<k;i++) { cout<<"w=("<<a[i]<<", "<<b[i]<<", "<<c[i]<<") = "<<w(a[i],b[i],c[i])<<endl; } return 0; }
```
by YWHS__LH @ 2018-09-18 20:11:24
@[zongying](/space/show?uid=126658)
by YWHS__LH @ 2018-09-18 20:11:40
```cpp
#include<bits/stdc++.h>
using namespace std;
long long a[10000],b[10000],c[10000];
long long dp[30][30][30];
int k;
int w(int x,int y,int z)
{
if(x<=0||y<=0||z<=0) return 1;
else if(dp[x][y][z]!=0) return dp[x][y][z];
else if(x>20||y>20||z>20) dp[x][y][z]=w(20,20,20);
else if(x<y&&y<z) dp[x][y][z]=w(x,y,z-1)+w(x,y-1,z-1)-w(x,y-1,z);
else dp[x][y][z]=w(x-1,y,z)+w(x-1,y-1,z)+w(x-1,y,z-1)-w(x-1,y-1,z-1);
return dp[x][y][z];
}
int main()
{
for(long long i=0;i<10000;i++)
{
k=i;
cin>>a[i]>>b[i]>>c[i];
if(a[i]==-1&&b[i]==-1&&c[i]==-1) break;
}
for(long long i=0;i<k;i++)
{
cout<<"w=("<<a[i]<<", "<<b[i]<<", "<<c[i]<<") = "<<w(a[i],b[i],c[i])<<endl;
}
return 0;
}
```
by zongying @ 2018-09-18 20:26:12
@[YWHS__LH](/space/show?uid=45299) 这个是我写的代码,全RE了
by zongying @ 2018-09-18 20:26:31
我也是,真是8懂
by 宇宙外来物 @ 2018-12-01 18:48:25