50,781
社区成员
发帖
与我相关
我的任务
分享
#include <bits/stdc++.h>
using namespace std;
using ll=long long;
const ll MOD=1000000007;
ll n,m,ans;
ll f[105][105][105];
int main(){
cin.tie(0),cout.tie(0);
ios::sync_with_stdio(false);
cin>>n>>m;
f[0][0][2]=1;
for(int i=0;i<=n;i++){
for(int j=0;j<=m;j++){
for(int k=0;k<=m;k++){
if(j&&k)f[i][j][k]=(f[i][j][k]+f[i][j-1][k+1])%MOD;
if(i&&k%2==0)f[i][j][k]=(f[i][j][k]+f[i-1][j][k/2])%MOD;
}
}
}
cout<<f[n][m-1][1];
return 0;
}