Run ID | 作者 | 问题 | 语言 | 测评结果 | 分数 | 时间 | 内存 | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|---|
133805 | 廖悦扬 | 最优分解 | C++ | 通过 | 100 | 0 MS | 264 KB | 374 | 2024-03-02 09:29:55 |
#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; }