修正笔误
This commit is contained in:
parent
6ee2aab80e
commit
8b0d9452e7
@ -127,7 +127,7 @@ public int arrangeCoins(int n) {
|
|||||||
int l = 0, h = n;
|
int l = 0, h = n;
|
||||||
while(l <= h){
|
while(l <= h){
|
||||||
int m = l + (h - l) / 2;
|
int m = l + (h - l) / 2;
|
||||||
long x = m * (m + 1L) / 2;
|
long x = m * (m + 1) / 2;
|
||||||
if(x == n) return m;
|
if(x == n) return m;
|
||||||
else if(x < n) l = m + 1;
|
else if(x < n) l = m + 1;
|
||||||
else h = m - 1;
|
else h = m - 1;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user