Run ID | 作者 | 问题 | 语言 | 测评结果 | 时间 | 内存 | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
7633 | luchenyuan | 金币 | C++ | 解答错误 | 0 MS | 236 KB | 260 | 2023-02-05 17:34:13 |
#include<iostream> using namespace std; int main() { int k=1; int day; int res=0; cin >> day; for (int i=1; i<=day; i++) { if (i==k*(k+1)*(2*k+1)/6) { k++; res+=2*k-3; } else { res+=k; } } cout << res; return 0; }