Advertisement
Guest User

Untitled

a guest
Jan 26th, 2020
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.57 KB | None | 0 0
  1. inline extract() {
  2.         extracting = true;
  3.         if
  4.                 :: !empty ->
  5.                         atomic {
  6.                                 pm = m;
  7.                                 res = a[0];
  8.                                 m--;
  9.                                 a[0] = a[m];
  10.                                 SiftDown(0);
  11.                                 isHeap();
  12.                                 find(); // добавил
  13.                         }
  14.                         extracting = false;
  15.                 :: else -> res = -1; skip;
  16.         fi;
  17.         extracting = false;
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement