441. 排列硬币





class Solution(object):
    def arrangeCoins(self, n):
        """
        :type n: int
        :rtype: int
        """
        return int(2 ** 0.5 * (n + 1 / 8) ** 0.5 - 1 / 2)

if __name__ == '__main__':
    solution = Solution()
    print(solution.arrangeCoins(5))
posted @ 2020-06-08 13:51  人间烟火地三鲜  阅读(119)  评论(0)    收藏  举报