提交时间:2024-03-02 09:49:46

运行 ID: 133842

#include <bits/stdc++.h> using namespace std; #define int long long int lst[105]; signed main() { int n; cin >> n; int idx = 0; for(int i = 2;n > lst[idx];i++) { lst[++idx] = i; n -= i; } if(n == lst[idx]) lst[idx]++; for(int i = 0;i < n;i++) { lst[idx-i]++; } int S = 1; for(int i = 1;i <= idx;i++) S *= lst[i]; cout << S; }