提交时间:2022-10-04 11:25:19
运行 ID: 57453
#include<cstdio> #define MAXN 50001 #define MOD 998244353 int max(int a,int b) { return a>b?a:b; } int main() { int n,x,y; scanf("%d%d%d",&n,&x,&y); int dp[MAXN]; dp[0]=1; for(int i=1;i<=x>>1;i++) { dp[i]=0; for(int j=max(i-n,0);j<=i>>1;j++) if(i-j!=y) dp[i]+=dp[j],dp[i]%=MOD; } int ans=0; for(int i=max(x-n,0);i<=x>>1;i++) if(x-i!=y) ans+=dp[i],ans%=MOD; printf("%d\n",ans); return 0; }