This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <cstdio> | |
| #include <iostream> | |
| using namespace std; | |
| const int MAXN = 500005; | |
| // Max heap for floors we need to go down to (stores negative values to use as max heap) | |
| struct MaxHeap { | |
| int arr[MAXN]; | |
| int cnt; |