Skip to content

Instantly share code, notes, and snippets.

@xiaom
Created July 16, 2012 22:56
Show Gist options
  • Save xiaom/3125605 to your computer and use it in GitHub Desktop.
Save xiaom/3125605 to your computer and use it in GitHub Desktop.
use priority queue
// top k denest regions: the k-th region is on the top
class RegionCmp {
public:
bool operator()(const Region& lhs, const Region& rhs) const {
return lhs.d > rhs.d;
}
};
typedef priority_queue<Region, vector<Region>, RegionCmp> RegionPQ;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment