题目描述
Sorting Pairs Write a program which print coordinates (xi,yi) of given n points on the plane by the following criteria.
first by x-coordinate in case of a tie, by y-coordinate
输入
The input is given in the following format.
n
x0 y0
x1 y1
:
xn−1 yn−1
In the first line, the number of points n is given. In the following n lines, coordinates of each point are given.
输出
Print coordinate of given points in order.
样例输入
1 | 5 |
样例输出
1 | 2 1 |
提示
1≤n≤100,000
−1,000,000,000≤xi,yi≤1,000,000,000
题解
1 | #include <set> |