@[Diamond_ZuanShi](/user/901793) ,把能开long long的都开开,或直接`#define int long long `就过了,求关
by goIdie @ 2024-08-05 10:44:26
OK,已关。
PS:@[goIdie](/user/1041965) 能互关吗?
by Diamond_ZuanShi @ 2024-08-05 10:45:36
@[Diamond_ZuanShi](/user/901793) ,目前不太支持
by goIdie @ 2024-08-05 10:47:15
不对,我代码好像发错了,我再发一遍,sorry
```cpp
#include<bits/stdc++.h>
using namespace std;
long long x,y,z,ans[155][155][155];
long long w(int a,int b,int c)
{
if(a<=0||b<=0||c<=0)return 1;
if(a>20||b>20||c>20)return w(20,20,20);
if(ans[a][b][c])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);
else 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()
{
while(cin>>x>>y>>z)
{
if(x==-1&&y==-1&&z==-1)break;
cout<<"w("<<x<<", "<<y<<", "<<z<<") = "<<w(x,y,z)<<endl;
}
return 0;
}
```
by Diamond_ZuanShi @ 2024-08-05 10:47:57
@[goIdie](/user/1041965) long long main()?
by ouxiyao @ 2024-08-05 14:47:24
@[ouxiyao](/user/1155764) ,可以改成`signed main`
by goIdie @ 2024-08-05 18:16:59
对不起,我发现我帖子里的错误代码好像贴错了,真正的错误代码在第四个帖,辛苦各位大佬再帮我看看。
by Diamond_ZuanShi @ 2024-08-05 20:30:38
x,y,z为long long ,读进函数变成int了?
还有,题目说了,x,y,z有一个大于20就全部变为20,防止爆数据,特判在主程序
by ouxiyao @ 2024-08-06 13:41:02