题解 | #[NOIP2015]金币#
[NOIP2015]金币
https://www.nowcoder.com/practice/8f71f5670e6a45118d24d13868a2da9e
#include <stdio.h>
int main()
{
int n,c=1,q=1,s=0;
scanf("%d",&n);
for(int i=1;i<=n;i++)
{
s+=c;q--;
if(q==0)
{
c++;q=c;
}
}
printf("%d",s);
return 0;
}