3
int getNumberOfBacklogOrders(vector<vector<int>> &orders) {6
priority_queue<vector<int>> buyBacklog;7
priority_queue<vector<int>, vector<vector<int>>, greater<vector<int>>> sellBacklog;9
for (auto order : orders) {11
buyBacklog.push(order);13
sellBacklog.push(order);15
while (!buyBacklog.empty() && !sellBacklog.empty() &&16
sellBacklog.top()[0] <= buyBacklog.top()[0]) {17
auto btop = buyBacklog.top();19
auto stop = sellBacklog.top();21
int diff = btop[1] - stop[1];24
buyBacklog.push(btop);25
} else if (diff < 0) {27
sellBacklog.push(stop);32
int ans = 0, mod = 1e9 + 7;33
while (!buyBacklog.empty()) {34
ans = (ans + buyBacklog.top()[1]) % mod;37
while (!sellBacklog.empty()) {38
ans = (ans + sellBacklog.top()[1]) % mod;