Last active
November 19, 2021 08:49
-
-
Save Bloofer/d8661f502be59301357677e948a9a807 to your computer and use it in GitHub Desktop.
pq
This file contains 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
struct Data{int idx; int value;}; | |
Data db[MAX_N]; | |
int pri[MAX_N]; | |
priority_queue<pair<int, Data*>> PQ; | |
void find(){ | |
while(!PQ.empty()){ | |
int pri = PQ.top().first; | |
Data *p = PQ.top().second; | |
PQ.pop(); | |
if(pri[p->idx]!=p->pri) continue; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment