提交时间:2022-10-04 11:25:01
运行 ID: 57449
#include<bits/stdc++.h> using namespace std; const int N =1e6+10; int dp[N]; int main() { // freopen("J3.in","r",stdin); // freopen("J3.out","w",stdout); int n,x,y; cin>>n>>x>>y; dp[0]=1; for(int i=1;i<=n;i++) { if(i==y) continue; for(int j=i;j<=min(i*2,x);j++) { dp[j]+=dp[j-i]; dp[j]%=998244353; } } cout<<dp[x]<<endl; }