fork download
  1. #include <iostream>
  2. #include <cmath>
  3.  
  4. using namespace std;
  5.  
  6. int main() {
  7. int n;
  8. cin>>n;
  9.  
  10. string major, res;
  11. int year, max_year=0;
  12.  
  13. while(n--){
  14. cin>>major>>year;
  15.  
  16. if(max_year<year){
  17. max_year=year;
  18. res=major;
  19. }
  20. }
  21.  
  22. cout<<res;
  23.  
  24. return 0;
  25. }
Success #stdin #stdout 0.01s 5308KB
stdin
1
bigdata 2026
stdout
bigdata