记录编号 359363 评测结果 AAAAAAAAAA
题目名称 [NOIP 2015PJ]金币 最终得分 100
用户昵称 GravatarkZime 是否通过 通过
代码语言 C++ 运行时间 0.003 s
提交时间 2016-12-22 13:38:15 内存使用 0.31 MiB
显示代码纯文本
  1. #include<iostream>
  2. #include<cstdio>
  3. using namespace std;
  4. int main(){
  5. ios::sync_with_stdio(false);
  6. freopen("2015coin.in","r",stdin);
  7. freopen("2015coin.out","w",stdout);
  8. int n,d=0,d1=0,a=1,s=0;
  9. cin>>n;
  10. for(;;){
  11. d++;d1++;
  12. s+=a;
  13. if(d1==a){
  14. a++;
  15. d1=0;
  16. }
  17. if(d==n)break;
  18. }
  19. cout<<s;
  20. }