时间: 2020-11-25|31次围观|0 条评论

 1 static int wing=[]()
 2 {
 3     std::ios::sync_with_stdio(false);
 4     cin.tie(NULL);
 5     return 0;
 6 }();
 7 
 8 class Solution 
 9 {
10 public:
11     int arrangeCoins(int n) 
12     {
13         return sqrt((long long)n*2+0.25)-0.5;
14     }
15 };

直接数学公式解题

转载于:https://www.cnblogs.com/zhuangbijingdeboke/p/9103867.html

原文链接:https://blog.csdn.net/weixin_30342827/article/details/96762015

本站声明:网站内容来源于网络,如有侵权,请联系我们,我们将及时处理。

本博客所有文章如无特别注明均为原创。
复制或转载请以超链接形式注明转自起风了,原文地址《441. Arranging Coins
   

还没有人抢沙发呢~