Untitled
#include <iostream> #include <bits/stdc++.h> using namespace std; struct toado{ int a; int b; bool operator (const a.b &other){ if(toado.a > other.a) return toado.a; if(toado.a == other.a){ if(toado.b < other.b) return toado.b; } } }; pair<int, int> a[10000], b[10000]; int main() { int n; cin >> n; sort(toado + 1, toado+n+1, operator); for(int i; i < n; i++){ cin >> a[i] >> b[i]; } cout << toado.a << toado.b; }
Leave a Comment