Last active
November 19, 2021 08:42
-
-
Save Bloofer/b2956bc792b74f4ae64b14b5e31df2c2 to your computer and use it in GitHub Desktop.
lazy_update
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 value; bool flag;}; | |
Data db[MAX_N]; | |
priority_queue<Data*> PQ; | |
void find(){ | |
Data *p; | |
while(!PQ.empty()){ | |
p = PQ.top(); | |
PQ.pop(); | |
if(!p->flag) continue; | |
else break; | |
// ... | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment