13095 - Submission crawler   

Description

Yazmonkey is an outstanding hacker, he's paid to get the scoreboard of the final exam of Introduction to Programming since the original scoreboard is blocked.

You're Yazmonkey's apprentice, and Yazmonkey wants to test your ability, so he wrote a program to crawl all the submissions from the final exam and asked you to generate the scoreboard. If you failed this mission, Yazmonkey will punch you in face and expel you.

Reference:
Web Crawler
HTML

You don't have to know how to write HTML, you just have to parse the information that is useful from the input, and output the scoreboard.
The first test case is the Sample Input.

Input

Input contains the raw data of the HTML table of all the submisstions. Guarantee that all html tag meets the following format: 

<tagname>Content goes here...</tagname>

First ten line is as follow, but it may have more/less spaces or even no space between the content and the html tag or infront/behind the html tag. 

<table>
  <thead>
    <tr>
      <th>Submit Time</th>
      <th> User</th>
      <th>Problem </th>
      <th>Status</th>
    </tr>
  </thead>
  <tbody>


You can obviously ignore first ten lines since you only care about the submissions.
Next for all submissions, they should begin with <tr> in single line, and end with </tr> in single line. For every  <tr> .... </tr, there're four lines inside it, each line contains one <th> .... </th>. The html tag of <th> .... </thcontains the information that you want, which is Submit Time, User, Problem, Status in order from top to bottom.

Still, it may have more/less spaces or even no space between the content and the html tag or infront/behind the html tag. That is, the below HTML Tag are all valid.
1. 
<tr>
<td>    00:22 </td>
        <td>4        </td>
<td>  A</td>
             <td>   Wrong Answer    </td>
      </tr>

2.

<tr>
<td>00:22</td>
<td>4</td>
<td>A</td>
<td>Accepted</td>
</tr>

The input ends when there's two line containing the following tags. Of course, it may have more/less spaces or even no space infront/behind the html tag.

   </tbody>
</table>

The information of the submission contains four things:

  1. Submit Time
    The format of the submit time is like the 24-hour clock such as 11:39, 00:45, 02:16. But it represents how many times after the contest starts. For instance, 11:39 means it's 11 hours and 39 minutes after the contest start, 00:45 means it's 45 minutes after the contest start.  The contest is last for one day, so the possible submit time is from 00:00 to 23:59.
  2. User
    It is the ID of the user who submits this submission, ID is an integer in range of 0 ~ 100000.
  3. Problem
    It's the problem that the submission is submitted to, and it's represented by an uppercase alphabet from A to J. That is, there's 10 problems to submit.
  4. Status
    There's only two types of status. Guarantee that there's only one space between "Wrong" and "Answer".
    1. Accepted
    2. Wrong Answer

 

If we show the sample input in the browser, it may look like the following picture.

Guarantee that there's at most 100 characters in each line and the number of submissions is at least one and at most 200000.
The submit time of the input HTML table is ascending
from top to bottom.

Output

Output the scoreboard that generated from the input html table.
You should output N lines, N is the number of user that have at least one submission.
Each line is the score distribution of each user.
The user that got Accepted on more problems should output first. If two user have the same number of problems that they got Accepted, output the the user with less total penalty first. If two user still have the same total penalty, output the user with less user ID first.
The penalty of a single problem is: 

20 × (the number he'd tried before he first get Accepted) + the submit time of the first Accepted submission (Turn into minutes).

And the total penalty is the sum of the penalty of every problem that the user get Accepted. That is, if he'd submitted to the problem, but eventually didn't get Accepted, don't count the penalty of it to the total penalty.

For each line output the follwing information seperated by space.
First output the user id, and then x/y of all the ten problems from A to J.
x := Total times that the user submit to this problem until his first AC submission(include the first AC submission). If the user hasn't submitted to this problem, replace it by "-".
y := The penalty of the problem. If the user hasn't got Accepted on this problem, replace it by "-".

Lastly, output the number of problem that the user get Accpeted and the total penalty.
Be aware that the user may submit to the problem after he/she had already get Accpeted.

Sample Input  Download

Sample Output  Download

Tags




Discuss