| 记录编号 | 332074 | 评测结果 | AAAAAAAAAA | ||
|---|---|---|---|---|---|
| 题目名称 | 2110.[NOIP 2015PJ]金币 | 最终得分 | 100 | ||
| 用户昵称 | 是否通过 | 通过 | |||
| 代码语言 | C++ | 运行时间 | 0.013 s | ||
| 提交时间 | 2016-10-28 14:40:02 | 内存使用 | 0.28 MiB | ||
#include<iostream>
#include<cstdio>
using namespace std;
int n;
int main(){
freopen("2015coin.in","r",stdin);
freopen("2015coin.out","w",stdout);
cin>>n;
int t=1,now=1,ans=0;
while(n>0){
ans+=now;
t--;
if(t==0){
now++;
t=now;
}
n--;
}
cout<<ans;
fclose(stdin);
fclose(stdout);
return 0;
}