Run ID 作者 问题 语言 测评结果 分数 时间 内存 代码长度 提交时间
75656 谢博宇 金币 C++ 通过 100 1 MS 248 KB 412 2026-07-04 16:41:09

Tests(10/10):


#include<bits/stdc++.h> using namespace std; int main() { int k; cin>>k; int t=0; int c=0; int n=1; while(c<k) { if(c+n<=k) { t+=n*n; c+=n; }else{ int r=k-c; t+=r*n; c=k; } n++; } cout<<t<<endl; return 0; }


测评信息: