https://blog.csdn.net/weixin_39453270/article/details/80433626
参考了Chen_Jr_dalao的博客!!!!!!(附上我一点浅显的理解)
D. Sand Fortress
time limit per test
2 seconds
memory limit per test
256 megabytes
input
standard input
output
standard output
You are going to the beach with the idea to build the greatest sand castle ever in your head! The beach is not as three-dimensional as you could have imagined, it can be decribed as a line of spots to pile up sand pillars. Spots are numbered 1 through infinity from left to right.
Obviously, there is not enough sand on the beach, so you brought n packs of sand with you. Let height hi of the sand pillar on some spot ibe the number of sand packs you spent on it. You can't split a sand pack to multiple pillars, all the sand from it should go to a single one. There is a fence of height equal to the height of pillar with