QOJ.ac

QOJ

Limite de temps : 1.0 s Limite de mémoire : 256 MB Points totaux : 100 Hackable ✓

#15178. 点球大战

Statistiques

众所周知,在 ICPC 系列赛事中,罚时是排名的一个非常重要的标准。新来的工程师 Zag 开发了一个评测系统。该系统计算罚时的方法如下:

  1. 对于每一次通过(accepted)的提交,系统会记录第一次通过的时间为 $A$,以及在此之前未通过的提交次数为 $B$,从而生成对应的字符串 $A+B$,其对应的罚时贡献为 $A + B \times 20$。
  2. 对于其他未通过的提交,系统会记录未通过的提交次数为 $C$,生成字符串 $-C$,其对应的罚时贡献为 $0$。

现在 Zag 已经开发出了生成字符串的功能。他希望你能帮助他实现一个功能,通过系统生成的字符串来计算对应的罚时贡献。

输入格式

第一行仅包含一个整数 $n$ ($1 \le n \le 20$),表示生成的字符串数量。

从第 $2$ 行到第 $n + 1$ 行,每行是一个符合题目描述格式的字符串,即形式为 $A+B$ 或 $-C$ ($0 \le A, B, C \le 300$)。

输出格式

输出 $n$ 行,每行一个整数,表示对应的罚时。

样例

输入样例 1

5
16+0
160+20
-3
255+6
-0

输出样例 1

16
560
0
375
0

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.