QOJ.ac

QOJ

時間限制: 1.0 s 記憶體限制: 32 MB 總分: 55

#17572. LIGA

统计

当球员们在局间休息时,电视台播放着乏味的广告。Zvonko 打开了电视机上的图文电视(teletext)功能,正在查看足球联赛的最新比分和积分榜。一向敏锐的他想出了一个新的数学游戏。

积分榜包含每个队伍的五项统计数据:总比赛场数、胜场数、平局场数、负场数以及获得的积分。队伍每获胜一场获得 3 分,平局一场获得 1 分。

Zvonko 注意到,某些属性的值可以通过其他属性计算得出。

请编写一个程序,输入一个部分属性未知的积分榜,并填补缺失的数据。

不同队伍的数据之间没有关联。例如,积分榜中可能会出现所有队伍都赢下了所有比赛的情况(尽管这在真实的联赛中是不可能的)。

每个队伍最多进行了 100 场比赛(即使该数据可能是缺失的字段之一)。

输入格式

第一行包含一个整数 $N$ ($1 \le N \le 1000$),表示联赛中的队伍数量。

接下来的 $N$ 行,每行包含一个队伍的 5 个数据字段,字段之间用单个空格分隔,分别对应题目描述中的 5 项统计数据。每个字段包含一个非负整数,或者在数据未知时为字符 ?(问号)。

输入数据保证是自洽的,且有唯一的方法来确定缺失字段的值。

输出格式

输出填补了缺失字段后的积分榜。

说明

对于每个测试用例,你的得分将与正确求解的队伍数量成线性正比(向下取整)。如果你的程序超时或发生其他错误,该测试用例的得分为 0。

样例

输入样例 1

5 
27 21 3 3 66 
27 18 6 3 ? 
? 15 5 7 50 
? 14 7 5 ? 
? 14 ? 8 47

输出样例 1

27 21 3 3 66 
27 18 6 3 60 
27 15 5 7 50 
26 14 7 5 49 
27 14 5 8 47

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.