Skip to content

Instantly share code, notes, and snippets.

@mmun
Created January 20, 2017 05:34
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 mmun/e553fde3558c2f6d46626d7f84989805 to your computer and use it in GitHub Desktop.
Save mmun/e553fde3558c2f6d46626d7f84989805 to your computer and use it in GitHub Desktop.
struct activity {
long s, e, h;
bool operator<(const activity& other) const {
return e < other.e;
}
};
// code snippet
upper_bound(activities.begin(), activities.end(), {0, x, 0}) - a.begin();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment