Skip to content

Instantly share code, notes, and snippets.

@AlexDenisov
Last active December 15, 2015 01:08
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 AlexDenisov/5177463 to your computer and use it in GitHub Desktop.
Save AlexDenisov/5177463 to your computer and use it in GitHub Desktop.
#include <iostream>
#include <set>
using namespace std;
struct Point {
int x;
int y;
Point(int x, int y)
: x(x), y(y) {}
bool operator < (const Point &point) const {
return this->x < point.x || this->y < point.y;
}
};
int main(int argc, char *argv[]) {
Point p1(0,5);
Point p2(0,5);
Point p3(11,15);
set<Point> points;
points.insert(p1);
points.insert(p2);
points.insert(p3);
cout << points.size() << endl;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment