ac

P2669 [NOIP2015 普及组] 金币

する晋宇 @ 2017-04-02 09:04:37

var i,god,day,zh,d,n,k:longint;
  begin
    read(day);
    zh:=1;
    d:=1;
    god:=0;
    for i:=1 to day+1 do
      begin
        god:=god+d;
        if i-zh=d then begin
                         d:=d+1;
                         zh:=i;
                       end;
      end;
      write(god-1);
  end.

在洛谷, 享受Coding的欢乐

关于洛谷 | 帮助中心 | 洛谷社区规则 | 用户协议 | 联系我们 2013-2017 , 洛谷 © Powered by 厦门一中

Developed by @kkksc03, @lzn, @w, @lin_toto

All rights reserved 浙ICP备16000783号-1. 站长统计


by CrTsIr400 @ 2020-06-26 10:12:52

考古


by 警策看取 @ 2020-06-26 10:28:03

tlqtj,jbl(((


by UnyieldingTrilobite @ 2020-06-26 12:50:36

考古


by PRAGMATISM @ 2020-06-26 15:39:25

考古


|