Lang:G++
Edit12345678910111213141516171819202122232425262728293031#include <iostream>#include <set>#include <map>#include <vector>using namespace std;struct Node {int x, y;Node(int a, int b) {x = a, y = b;}bool operator < (const Node &b) const {if (x < b.x) return true;else if (x == b.x ) {if (y < b.y) return true;elsereturn false;}return false;}};void findAndInsert(set<Node> &S, Node tmp) {set<Node>::iterator it;it = S.find(tmp);if ( it != S.end()) {S.erase(tmp);}else {S.insert(tmp);