13473 - Scoreboard Parsing (cheat)   

Description

Calculate the score of students from the NTHU OJ scoreboard based on how many test cases a student has passed.

This is a continued problem from Problem 13849. (https://acm.cs.nthu.edu.tw/problem/13849/)

In this problem, we are going to handle the situation that there are some users who cheat on certain problems.

Input

The input consists of three parts as demonstrated below.

0.5 0.25 0.25

1,106095014,3/3,1/1,1/1,5
2,106095029,3/3,1/1,0/1,5,d1,d3
3,GEC2_105072127,1/3,1/1,0/1,5,d1

X014
X2127

  1. The first line (highlighted in yellow) is the weights for each problem in the contest where you need to apply the "weighted average" to calculate the final score for each user.
     
  2. The second part is the lines highlighted in green background. Each line describes the answering record for the given user and there could be more than 3 lines in this part.

    The syntax of each line is explained by this example:

    2,106095029,3/3,1/1,0/1,5,d1,d3

    Rank, User, Problem 1 Result, Problem 2 Result, ... , Problem N Result, Total Passed Cases, ignored answers, ...

    where you can ignore the rank and calculate the weighted average for each problem according to the weights provided in the 1st line. The formula of the weighted sum is provided below.

    weighted average
    where w denotes the weight and x denotes the score for each problem.

    For the ignored answers, it denotes the user who cheated on the specific problem and you need to set the scores of that problem to be "0". For example, we have "d1, d3" which indicates that this user (106095029) cheated on problems 1 and 3. Thus, we need to set the scores for these two problems as 0 and the final score should only accumulate from the remaining problems, i.e. problem 2 in this case.
    Note that the weights are not affected by the cheating. It is still 0.5, 0.25, and 0.25 for problem 1, 2, 3, respectively.
    Finally, this user only gets 25 points contributed by problem 2, which has a 0.25 weight and obtains a 100 point score.
     
  3. The last part is the lines highlighted in red background. These lines indicate the users who cheated for the entire contest and, therefore, their final score should be directly set as 0. (Note that it is optional to have this part.)

    In the given example above, the scores for the records that its username ended with 014 or 2127 should be set as 0.

 

Output

The score for each student of the given contest with the format:

User,Score

Note that

  1. The order of the output score should follow the same order as the input. That is, you can not ignore any record from the input. E.g. let's say there are 10 input records, you need to output 10 scores corresponding to the input records.
  2. The score should have 2 decimals.

Sample Input  Download

Sample Output  Download

Tags




Discuss