Classic
Clean & simple
Crystal
Glassmorphism + Neon
Cyberpunk
Neon glitch art
🚫
违规Action检测
禁止Use右键菜单
⚠️ 此Action已被系统记录
1

Brilliant Programmers Show

📝 Solutions 🔵 仅限 C++
Problems Description
<span style="font-family:'Times New Roman';font-size:14px;line-height:normal;">  Hunan TV holds many talent shows every year, such as Happy Girls and Super Boys which attract the attention of the whole country. This year Hunan University held a new type of talent show called Brilliant Programmers. Millions of programmers had registered online and only top N most brilliant programmers got the opportunity to compete on site. The organizer had hold ten rounds of qualification contest and programmers were ranked by their total scores. The programmers who ranked after N were eliminated.</span><br /> <span style="font-family:'Times New Roman';font-size:14px;line-height:normal;">  The final show continued for a very long time. Initially programmers were ranked by their qualification scores. The rule was special: A challenge may be happen between exactly two adjacent ranked programmers at any time and the lower ranked one tries to solve the other’s problem. If the challenger successfully solves this problem, their ranks exchange. Otherwise their ranks remain unchanged. It is guaranteed that a programmer never involved in two challenges at the same time. The top ranked programmer at last is the champion.</span><br /> <span style="font-family:'Times New Roman';font-size:14px;line-height:normal;">  The show was over but… The hard disk which logs the whole progress was burned out. After data rescue, the number of successful challenges of each programmer was recovered but the final rank was disappeared forever. During the rescue some errors may occur, which lead to some wrong recovered numbers. Is the show possible at all? If it is possible, can you help to find the champion from the very limited information?</span>
Input格式
<div class="panel_content" style="margin:0px;padding:0px 20px;font-size:14px;font-family:'Times New Roman';">   There are multiple test cases.<br />   Each test case is described in two lines. The first line contains one integer N: the number of programmers. The second line contains a sequence of integers A<sub>i</sub>that gives the number of successful challenges of the programmer initially ranked i-th.&nbsp;<br /> 1 &lt;= N &lt;= 10<sup>6</sup>, 0 &lt;= A<sub>i</sub>&nbsp;&lt;= 10<sup>9</sup><br />   The input will finish with the end of file. </div> <div> <br /> </div>
Output格式
<span style="font-family:'Times New Roman';font-size:14px;line-height:normal;">  For each case the output contains only one line.</span><br /> <span style="font-family:'Times New Roman';font-size:14px;line-height:normal;">  If it is an impossible show, output “Bad Rescue”. Otherwise if the champion is uniquely determined, output the initial rank of the champion. Output “Unknown” if the champion is not sure.</span>
Sample
Sample Input 1
2 0 1 3 0 1 5 3 0 1 1
Sample Output 1
2 Bad Rescue Unknown
Submit Code
请先Login后Submit

🤖 AI 解题助手

OpenRouter
就绪
👋 你好!我是 AI 解题助手。
我已阅读了这problems题,可以帮你points析思路、提供Code示例。
🔓 完全Free · 无需消耗 Token