Run ID 作者 问题 语言 测评结果 分数 时间 内存 代码长度 提交时间
133842 罗恩祥 最优分解 C++ 通过 100 0 MS 248 KB 379 2024-03-02 09:49:46

Tests(10/10):


#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; }


测评信息: