题解 | #放苹果#
放苹果
https://www.nowcoder.com/practice/4f0c1e21010e4d849bde5297148e81d9
int res(int m, int n) { if (n == 0 && m == 0) { return 1; } if (n == 0 && m != 0) { return 0; } if (m >= n) { return res(m - n, n) + res(m, n - 1); } else { return res(m, m); } } int main() { int m, n; scanf("%d %d", &m, &n); printf("%d", res(m, n)); return 0; }
}