Run ID 作者 问题 语言 测评结果 分数 时间 内存 代码长度 提交时间
75702 谢润景 金币 C++ 通过 100 1 MS 248 KB 343 2026-07-11 19:59:39

Tests(10/10):


#include <bits/stdc++.h> using namespace std; int k,ts,p,tss,zp; int t(int a,int n,int k){ if(n+a>=k){ return a; } else{ return t(a+1,n+a,k); } } int main(){ cin>>k; ts=t(1,0,k); // cout<<ts; p=((ts-1)*ts*((ts-1)*2+1))/6; tss=k-(1+ts-1)*(ts-1)/2; zp=p+ts*tss; cout<<zp; return 0; }


测评信息: