编程介的小学生 2017-05-02 12:14 采纳率: 20.5%
浏览 899
已采纳

Easy Task

Last year there were a lot of complains concerning the set of problems. Most contestants considered our problems to be too hard to solve. One reason for this is that the team members responsible for the problems are not able to evaluate properly whether a particular problem is easy or hard to solve. (We have created until now so many problems, that all seems quite easy.) Because we want our future contests to be better we would like to be able to evaluate the hardness of our problems after the contest, using the history of submissions.

There are a few statistics that we can use for evaluating the hardness of a particular problem: the number of accepted solutions of the problem, the average number of submissions of the problem and the average time consumed to solve it (as "General rules" of the contest state "the time consumed for a solved problem is the time elapsed from the beginning of the contest to the submittal of the accepted run."). For the latter two statistics we consider only the teams which solved this particular problem.

Needless to say we ask you to write a program that computes aforementioned statistics for all problems.

Task

Write a program that:

reads a history of submissions during an ACM contest,
computes for each problem the number of accepted solutions of the problem, the average number of submissions and the average time consumed to solve it,
writes the result.
Input Specification

The input consists of several test cases.
For each case, the first line contains one integer N (1<=N<=2000) being the number of submissions during the contest. Each of the next N lines describes one submission and contains a submission time (measured in seconds from the beginning of the contest), a team identifier, a problem identifier and a result of evaluating the submission, separated by single spaces. The submission time is a positive integer not greater than 18000. The team identifier is a non-empty string consisting of at most five small letters or digits. The problem identifier is a capital letter A, B, ..., or I. The result is a capital letter A (the submission is accepted) or R (the submission is rejected).
Submissions are given in nondecreasing order according to submission times and there are 100 teams competing.
Please note that if a problem is accepted all further submissions of this problem by the same team are possible but they should not be taken to the statistics.

Output Specification

The output of each test case consists of nine lines. The first line corresponds to problem A, the second line to problem B, and so on. Each line should contain the problem identifier, the number of accepted solutions of the problem, the average number of submissions done by teams that solved that problem and the average time consumed to solve it, separated by single spaces. The latter two statistics should be printed only if there was at least one accepted solution of the given problem and should be rounded to two fractional digits (in particular 1.235 should be rounded to 1.24).
There must be a blank line separating the outputs of two cases, but no extra lines at the end of output.

Sample Input

12
10 wawu1 B R
100 chau1 A A
2000 uwr2 B A
2010 wawu1 A R
2020 wawu1 A A
2020 wawu1 B A
4000 wawu2 C R
6000 chau1 A R
7000 chau1 A A
8000 pp1 A A
8000 zil2 B R
9000 zil2 B A
Output for the Sample Input

A 3 1.33 3373.33
B 3 1.67 4340.00
C 0
D 0
E 0
F 0
G 0
H 0
I 0

  • 写回答

1条回答 默认 最新

  • threenewbee 2017-05-17 15:58
    关注
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 c程序不知道为什么得不到结果
  • ¥40 复杂的限制性的商函数处理
  • ¥15 程序不包含适用于入口点的静态Main方法
  • ¥15 素材场景中光线烘焙后灯光失效
  • ¥15 请教一下各位,为什么我这个没有实现模拟点击
  • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置