编程介的小学生 2019-02-28 16:22 采纳率: 20.5%
浏览 184

一个淘汰比赛值的计算的问题,采用C语言和数据结构的实现的形式

Problem Description
In the year of 2045,the soccer championship is gradually replaced by Earth Super Soccer Cup(We will call it EarthCup for short later).

For one EarthCup,there are n(n≤50000) soccer teams participated in. Every two teams will have a game. It means that every team will have n−1 games with all the other teams.

In order to make the result clear, it is ruled that if the two teams of a game have the same score when the game ends.Penalty shootout will last until there is a result.

In the EarthCup,every team has a Mark,and will score one point after winning a game and zero after losing a game. The team with the highest mark will be the champion.

In the year of 2333, somebody found that some teams had hired hackers to attack and modified the data of the EarthCup for many years.Maybe because of the great amount of the teams, this serious cheating behavior has not been found during hundreds of years.

To check whether the data was modified, they started to check the "Mark Table" in the past.

But because of the long ages, there were only the final Mark of each team reserved. No one remember the exact result of each game.Now they want to find out some "Mark Table" that must have been modified.

"Must have been modified" means we can not get this "Mark Table" by any exact result of each game according to the rules was given by.

Input
There is an positive integer T(T≤50) standing for the number of testcases.

For each testcase, there is an positive integer n standing for the number of teams participate in EarthCup.

The followed n lines describe the "Mark table". The ith integer ai(0≤ai<n) standing for the final Mark of the ith team.

Hint:
For the first testcase:
One possible way is:
Team1 won Team2 and Team3,gained 2 marks.Team2 won Team3 but lost the game with Team1,gained 1 mark.Team3 lost both games and gained 0.

For the second testcase:
It's obviously impossible that all the teams would win all the games.So it must have been modified.
The Input ai is disordered.

Output
For each testcase, output "The data have been tampered with!"(without quotation) if it must have been modified,otherwise output "It seems to have no problem."(without quotation).

Sample Input
2
3
2
1
0
3
2
2
2

Sample Output
It seems to have no problem.
The data have been tampered with!

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥20 fluent无法启动
    • ¥15 孟德尔随机化r语言运行问题
    • ¥15 pyinstaller编译的时候出现No module named 'imp'
    • ¥15 nirs_kit中打码怎么看(打码文件是csv格式)
    • ¥15 怎么把多于硬盘空间放到根目录下
    • ¥15 Matlab问题解答有两个问题
    • ¥15 LCD12864中文显示
    • ¥15 在使用CH341SER.EXE时不小心把所有驱动文件删除了怎么解决
    • ¥15 gsoap生成onvif框架
    • ¥15 有关sql server business intellige安装,包括SSDT、SSMS。