hiho week 219 register

Ended

Participants:164

Verdict:Accepted
Score:100 / 100
Submitted:2018-09-12 15:45:06

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<algorithm>
using namespace std;
struct point {
    int x, y;
    bool operator<(const point &a) const {
        if(y < a.y) return 1;
        if(y > a.y) return 0;
        return x < a.x;
    }
} p[1000];
struct line {
    int x, y, len;
    bool operator<(const line &a) const {
        if(len < a.len) return 1;
        if(len > a.len) return 0;
        if(x < a.x) return 1;
        if(x > a.x) return 0;
        return y < a.y;
    }
    void set(int xx, int yy, int llen) {
        x = xx; y = yy; len = llen;
    }
} li[1000000];
int main()
{
    int n;
    cin >> n;
    for(int i = 0; i < n; ++i)
        cin >> p[i].x >> p[i].y;
    sort(p, p + n);
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX