Run ID | 作者 | 问题 | 语言 | 测评结果 | 时间 | 内存 | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
7634 | luchenyuan | 金币 | C++ | 通过 | 0 MS | 248 KB | 224 | 2023-02-05 17:35:45 |
#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+=k; } cout << res; return 0; }