Nội dung Bài tập
- Mã:
- C.UCPC23
- Tên:
- Benedict Brothers
- Dạng thi:
- acm
- Thang điểm:
- 1 điểm
- Giới hạn thời gian:
- 1 giây
- Giới hạn bộ nhớ:
- 256 MB
- Nguồn bài tập:
- Problem C - UIT Collegiate Programming Contest 2023
- Được tạo bởi:
- 4801104085
Benedict Brothers
To know the context of this problem, please watch Doctor Strange in the Multiverse of
Madness.While traveling among the multiverse, not only finding the Darkhole, Strange and Chavez
also spending time collecting some durians. After getting back to Universe numbered 616,
they recognized that n durians were received as free products (for sure, most things are free
in other universes). The problem is they do not know what to do with them. Because of
having too much free time, Chavez put these into scale and has known that the i-th one is
ai kilos.

A photo of durians, also known as king of fruits, a speciality of some Southeast Asia
Nations, famous for its smell and taste. ©Dreamstime.com
As a result, Wong and Strange have decided to play a game, called Benedict Brothers
Durian Eating Championship. Its rules are given as following:
America does not like the smell of durian, so she has decided not to be a player. However, she wants to know that if both players play optimally, who is considered to be the winner?1. In each turn, each player will choose exactly one in n of durians as mentioned above and eat it. However, to make the competition more exciting, its weight must be strictly greater than any others eaten in previous turns. If there are not any durians that satisfy the condition, the player would lose and the competition should stop.2. Wong and Strange will attend in this game. They move in turns and Wong will play first.
Input:
Output:The first line of the input contains an integer t (1 ≤ t ≤ 10), the number of test cases. Each test case is given in two continuous lines. The first line of test case consists of a non-negative integer n (|n| ≤ 100), the number of multiverse-collected durians. The second one has n positive integers a1, a2, . . . , an (|ai| ≤ 21520029), in kilos, the weight of these durians.
For each test case, print a single string in a single line, which is the name of the winner if both players play optimally.
Ví dụ:
Sample Input
Sample Output
1
3
616 838 3000
Wong
Note: Below is one of the optimal turns so that two players could play.
• In the first turn, Wong could choose the 616 kilos durian and eat it.• In the second turn, the 838 kilos is selected by Strange.• In the third turn, the last one satisfies the condition so Wong will get it.• There are not any durians left for Strange to choose, so he is going to lose the game.
Theme :
Mời bạn soạn code
Ai có thể xem bài này :
Thông tin
Phần thảo luận