提交时间:2024-03-02 09:29:55

运行 ID: 133805

#include <bits/stdc++.h> #define int long long using namespace std; const int N = 200 + 5; int n, t, a[N]; signed main() { scanf("%lld", &n); for (int i=2; n > a[t]; i++) { a[++t] = i; n-=i; } if (n == a[t]) a[t] ++; for (int i=0; i<n; i++) a[t-i]++; int ans = 1; for (int i=1; i<=t; i++) ans *= a[i]; printf("%lld", ans); return 0; }