Run ID | 作者 | 问题 | 语言 | 测评结果 | 分数 | 时间 | 内存 | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|---|
133585 | 黄一航 | 最优分解 | C++ | 解答错误 | 10 | 0 MS | 240 KB | 307 | 2024-03-02 08:17:10 |
#include <bits/stdc++.h> #define int long long using namespace std; signed main() { int n; cin >> n; int ans = 1; int s = 0; for (int i = 2; ; i++) { s += i; if (n - s <= i) { ans *= n - s + i; s = n; break; } ans *= i; } printf("%lld\n",ans); return 0; }