来源:哔哩哔哩 2023-06-04 20:08:02

Time Limit: 2 sec / Memory Limit: 1024 MB


(相关资料图)

Score : 100100 points

Problem Statement

There are N people numbered 1,2,…1,2,…,N, sitting in this clockwise order around a round table. In particular, person 11 is sitting next to person N in the clockwise direction.

For each i=1,2,…,i=1,2,…,N, person i has a name Si and an age Ai. Here, no two people have the same name or the same age.

Starting from the youngest person, print the names of all N people in the order of their seating positions in clockwise order.

Sample Input 1 Copy

5alice 31bob 41carol 5dave 92ellen 65

Sample Output 1 Copy

caroldaveellenalicebob

The youngest person is person 33. Therefore, starting from person 33, print the names in the clockwise order of their seating positions: person 33, person 44, person 55, person 11, and person 22.

Sample Input 2

2takahashi 1000000000aoki 999999999

Sample Output 2 

aokitakahashi

下面是代码:

相关文章

最近更新