#P2772. 寻找平面上的极大点
寻找平面上的极大点
Description
On a plane, for two points and , we say that dominates if and .
Geometrically, this means that lies in the unbounded region whose upper-right corner is .
Given a set of points, there exist some points that are not dominated by any other point in the set; these points are called maximal points.
Write a program to find all maximal points and output their coordinates in increasing order of the -coordinate.
Input Format
The input consists of two lines. The first line is a positive integer , the number of points. The second line contains points’ coordinates. All coordinates are integers. No two points in the input share the same coordinates.
Output Format
Output all maximal points in increasing order of the -coordinate.
The output format is: .
Note: Each point is separated by ,, and there is no , after the last point. Missing or extra output will be judged incorrect.
5
1 2 2 2 3 1 2 3 1 4
(1,4),(2,3),(3,1)
Hint
For of the testdata: ; .
For of the testdata: ; .
Translated by ChatGPT 5
京公网安备 11011102002149号