编程介的小学生 2019-04-09 20:44 采纳率: 20.5%
浏览 124

寻找序列中的推断的数字,采用C程序的语言的程序设计的方式怎么做的

Problem Description
  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.
  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.
  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?

Input
  There are multiple test cases.
  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 Ai that gives the number of successful challenges of the programmer initially ranked i-th.
1 <= N <= 106, 0 <= Ai <= 109
  The input will finish with the end of file.

Output
  For each case the output contains only one line.
  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.

Sample Input
2
0 1
3
0 1 5
3
0 1 1

Sample Output
2
Bad Rescue
Unknown

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥100 c语言,请帮蒟蒻写一个题的范例作参考
    • ¥15 名为“Product”的列已属于此 DataTable
    • ¥15 安卓adb backup备份应用数据失败
    • ¥15 eclipse运行项目时遇到的问题
    • ¥15 关于#c##的问题:最近需要用CAT工具Trados进行一些开发
    • ¥15 南大pa1 小游戏没有界面,并且报了如下错误,尝试过换显卡驱动,但是好像不行
    • ¥15 没有证书,nginx怎么反向代理到只能接受https的公网网站
    • ¥50 成都蓉城足球俱乐部小程序抢票
    • ¥15 yolov7训练自己的数据集
    • ¥15 esp8266与51单片机连接问题(标签-单片机|关键词-串口)(相关搜索:51单片机|单片机|测试代码)