Skip to content

Instantly share code, notes, and snippets.

@Bloofer
Last active November 19, 2021 08:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Bloofer/b2956bc792b74f4ae64b14b5e31df2c2 to your computer and use it in GitHub Desktop.
Save Bloofer/b2956bc792b74f4ae64b14b5e31df2c2 to your computer and use it in GitHub Desktop.
lazy_update
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