蒟蒻0分全WA求调,玄关
  • 板块P1464 Function
  • 楼主qhcKing
  • 当前回复2
  • 已保存回复2
  • 发布时间2024/8/4 16:50
  • 上次更新2024/8/4 18:35:00
查看原帖
蒟蒻0分全WA求调,玄关
775011
qhcKing楼主2024/8/4 16:50
#include <bits/stdc++.h> 
using namespace std;  
#define ll long long
ll rem[21][21][21];
bool vis[21][21][21];
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(vis[a][b][c]) return rem[a][b][c];
	if(a<b&&b<c) rem[a][b][c]=w(a,b,c-1)+w(a,b-1,c-1)+w(a,b-1,c);
	else rem[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);
	vis[a][b][c]=1;
	return rem[a][b][c];
}
int main(){  
	while(1){
		ll a,b,c;
		cin>>a>>b>>c;
		if(a==-1&&b==-1&&c==-1) break;
		cout<<"w("<<a<<", "<<b<<", "<<c<<')'<<" = "<<w(a,b,c)<<endl;
	}
	return 0;  
}

大佬求调

2024/8/4 16:50
加载中...