#P1781. 宇宙总统

    ID: 2550 远端评测题 1000ms 125MiB 尝试: 0 已通过: 0 显示难度普及− 上传者: 标签>字符串高精度洛谷原创排序

宇宙总统

Problem Description

In the Earth calendar year 6036 AD, the entire universe is electing the most capable person as president. There are nn extraordinary candidates running for president. The votes have been fully counted; please determine who becomes the president.

Input Format

The first line contains an integer nn, the number of candidates.

The next nn lines contain the vote counts for candidates 11 through nn.

Output Format

Output two lines. The first line is an integer mm, the index of the elected candidate.

The second line is the elected candidate’s vote count.

5
98765
12365
87954
1022356
985678

4
1022356

Hint

The vote count can be very large, up to 100100 digits.

1n201 \leq n \leq 20.

Translated by ChatGPT 5