#include #include #include #include using namespace std; int main() { int n; cin >> n; vector> points(n); for(int i = 0; i < n; i++) { cin >> points[i].first >> points[i].second; } sort(points.begin(), points.end(), [](const pair& a, const pair& b) { if(a.first == b.first) return a.second > b.second; return a.first > b.first; // x降序 }); vector> ans; int ymax = INT_MIN; for(auto &p : points) { if(p.second > ymax) { ans.push_back(p); ymax = p.second; } } reverse(ans.begin(), ans.end()); for(auto &p : ans) { cout << "(" << p.first << "," << p.second << ")"; } return 0; }