码迷,mamicode.com
首页 > 其他好文 > 详细

441. 排列硬币

时间:2020-06-08 14:38:44      阅读:59      评论:0      收藏:0      [点我收藏+]

标签:coin   pre   http   lang   lazy   range   技术   排列   alt   

技术图片
技术图片
技术图片

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))

441. 排列硬币

标签:coin   pre   http   lang   lazy   range   技术   排列   alt   

原文地址:https://www.cnblogs.com/panweiwei/p/13065253.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!