Run ID | 作者 | 问题 | 语言 | 测评结果 | 分数 | 时间 | 内存 | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|---|
314094 | tc242204朱乙毛 | NOIP2015 普及:第一题 金币 | C++ | 通过 | 100 | 0 MS | 272 KB | 203 | 2024-12-12 16:39:36 |
#include<bits/stdc++.h> using namespace std; int main(){ int n,sum=0,st=1,sd=1; cin>>n; for(int i=0;i<n;i++){ if(sd==0){ st++; sd=st; }sum+=st; sd--; }cout<<sum; return 0; }