Created
July 16, 2012 22:56
-
-
Save xiaom/3125605 to your computer and use it in GitHub Desktop.
use priority queue
This file contains hidden or 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
// 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