TCCC '25 Feb P1 - Attendance Trouble

View as PDF

Submit solution

Points: 3 (partial)
Time limit: 3.0s
Memory limit: 64M

Author:
Problem type

In an unnamed school's computer science class, an unnamed teacher is having trouble with attendance. This unnamed teacher wants to reward the student with the least absences, but the class has N students; far too many to go through manually! Thankfully, you are very skilled with programming and offer to write a program to do it automatically. Can you help your unnamed teacher out?

Input Specification

The first line of input will be an integer N (1 \le N \le 10000).
The next N lines of input will have a string S (1 \le |S| \le 50), the student's name; and integer A (0 \le A \le 100), the number of absences they have.
It is guaranteed that there will be no ties (i.e. only one student will have the least absences).

Output Specification

Output one line containing the name of the student with the least absences.

Sample Input

5
John 1
Jeremy 9
Smith 15
Sally 0
Caroline 4

Sample Output

Sally

Comments

There are no comments at the moment.