hiho week 301 register

Ended

Participants:52

Verdict:Accepted
Score:100 / 100
Submitted:2020-04-06 14:48:47

Lang:G++

Edit
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#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;
            else
                return 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);
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX