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 };

直接数学公式解题

posted on 2018-05-29 10:43  高数考了59  阅读(128)  评论(0)    收藏  举报