暴力DP过的,题意有点迷,反正看了题解的翻译意思是n个桌子5个a类气球3个b类气球问读诵好中摆放方式.
#include<bits/stdc++.h>
using namespace std;#define debug puts("YES");
#define rep(x,y,z) for(int (x)=(y);(x)<(z);(x)++)
#define ll long long#define lrt int l,int r,int rt
#define lson l,mid,rt<<1
#define rson mid+1,r,rt<<1|1
#define root l,r,rt
#define mst(a,b) memset((a),(b),sizeof(a))
#define pii pair<int,int>
#define fi first
#define se second
#define mk(x,y) make_pair(x,y)
const int mod=1e9+7;
const int maxn=505;
const int ub=1e6;
ll powmod(ll x,ll y){ll t; for(t=1;y;y>>=1,x=x*x%mod) if(y&1) t=t*x%mod; return t;}
ll gcd(ll x,ll y){if(y==0) return x;return gcd(y,x%y);
}
ll dp[maxn][10][10];
int main(){mst(dp,0),dp[0][0][0]=1;rep(i,1,maxn) rep(j,0,6) rep(k,0,4) rep(p,0,j+1) rep(q,0,k+1)dp[i][j][k]+=dp[i-1][j-p][k-q];int n;cin>>n;cout<<dp[n][5][3]<<"\n";return 0;
}