Lang:G++
Edit12345678910111213141516171819202122232425262728293031#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);