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
本站声明:网站内容来源于网络,如有侵权,请联系我们,我们将及时处理。
还没有人抢沙发呢~