Last active
December 15, 2015 01:08
-
-
Save AlexDenisov/5177463 to your computer and use it in GitHub Desktop.
This file contains 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
#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