提交时间:2022-10-04 11:27:05

运行 ID: 57471

#include<bits/stdc++.h> using namespace std; const int M=998244353; int n,x,y,dp[100010]; int sum[100010]; int main(){ scanf("%d%d%d",&n,&x,&y); dp[0]=sum[0]=1; for(register int i=1;i<=x;i++){ dp[i]=sum[i/2]%M; if(i>n) dp[i]=(dp[i]-sum[i-n-1])%M; if(y>=(i+1)/2&&y<=i) dp[i]=(dp[i]-dp[i-y])%M; sum[i]=(sum[i-1]+dp[i])%M; } printf("%d",dp[x]); return 0; }