提交时间:2022-10-04 11:26:23
运行 ID: 57462
#include <bits/stdc++.h> #define mod ((int)998244353) using namespace std; int n, x, y, ans; void SplitNumber(int idx, int sum) { if(sum == x) { ans = (ans+1)%mod; return; } else if(idx > n) return; for(int i=idx; i<=n; i++) { if(i==y || i<sum) continue; SplitNumber(i, sum+i); } } int main() { // freopen("J3.in", "r", stdin); // freopen("J3.out", "w", stdout); scanf("%d%d%d", &n, &x, &y); SplitNumber(1, 0); printf("%d", ans); return 0; }