提交时间:2023-01-24 11:35:39

运行 ID: 6452

#include<bits/stdc++.h> using namespace std; int main(){ int k; cin>>k; int s=0,x=0,y=1; for(int i=1;i<=k;++i){ x++; s+=y; if(x==y){ ++y; x=0; } } cout<<s<<endl; return 0; }