This commit is contained in:
CyC2018 2018-04-18 13:49:15 +08:00
commit 6942cf0cf4
5 changed files with 6 additions and 2 deletions

View File

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

View File

@ -1375,7 +1375,7 @@ poll 和 select 在速度上都很慢。
几乎所有的系统都支持 select但是只有比较新的系统支持 poll。 几乎所有的系统都支持 select但是只有比较新的系统支持 poll。
## eopll 工作模式 ## epoll 工作模式
epoll_event 有两种触发模式LTlevel trigger和 ETedge trigger epoll_event 有两种触发模式LTlevel trigger和 ETedge trigger

View File

@ -102,7 +102,11 @@
position-0 : (2,3,1,0,2,5) // 2 <-> 1 position-0 : (2,3,1,0,2,5) // 2 <-> 1
(1,3,2,0,2,5) // 1 <-> 3 (1,3,2,0,2,5) // 1 <-> 3
(3,1,2,0,2,5) // 3 <-> 0 (3,1,2,0,2,5) // 3 <-> 0
<<<<<<< HEAD
(0,1,2,3,2,5) // already in position (0,1,2,3,2,5) // already in position
=======
            (0,1,2,3,2,5) // already in position
>>>>>>> d1687d819fdd50d1b3323cfb327b355e2b5eca35
position-1 : (0,1,2,3,2,5) // already in position position-1 : (0,1,2,3,2,5) // already in position
position-2 : (0,1,2,3,2,5) // already in position position-2 : (0,1,2,3,2,5) // already in position
position-3 : (0,1,2,3,2,5) // already in position position-3 : (0,1,2,3,2,5) // already in position

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.0 KiB

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 38 KiB