eolymp
bolt
Try our new interface for solving problems
Problems

Navid The Judge

Navid The Judge

\textit{"Testing can only prove the presence of bugs, not their absence."} \textit{Edsger Dijkstra} The ACM group of SBU has decided to develop a new application of creating scoreboard for the next contest. Judge Navid will use this application to judge your submissions! Your job is to write a program for judge Navid which reads a list of submissions in a programming contest and generate the final scoreboard. Teams are ranked according to most problems solved. Teams placing who solve the same number of problems are ranked first by list total time and, if need be, by the earliest time of submittal of the last accepted run. The total time is the sum of the time consumed for each problem solved. The time consumed for a solved problem is the time elapsed from beginning of the contest to the submittal of the first accepted run plus twenty penalty minutes for every previously rejected run for that problem. There is no time consumed for a problem that is not solved. For example, consider a situation when two teams, "\textbf{Chormangz}" and "\textbf{D&C}", tie by solving two problems each. The team Chormangz submitted their solutions to \textbf{A} and \textbf{B} at \textbf{1:00} and \textbf{2:45} after the beginning of the contest. They had a rejected run on \textbf{C}, but it was ignored since they didn't solve \textbf{C}. The team \textbf{D&C} submitted solutions to problems \textbf{A} and \textbf{C} at \textbf{1:20} and \textbf{2:00} after the beginning. They had one rejected run on \textbf{C}. Then, the total time is \textbf{1:00+2:45=3:45} for team \textbf{Chormangz} and \textbf{1:20+2:00+0:20=3:40} for team \textbf{D&C}. The tie is broken in favor of Team \textbf{D&C}. The result of each submission which is determined by judge Navid is one of these messages: \begin{itemize} \item Accepted → AC \item Compile Error → CE \item Time Limit Exceeded → TLE \item Run Time Error → RTE \item Wrong Answer → WA \end{itemize} \InputFile Input is a list of submissions. Each submission is designated by a line containing four fields which are separated by slashes. The first field is the team name (\textbf{1} to \textbf{10} characters). The second field is the problem \textbf{ID} (One character from "\textbf{A}" to "\textbf{Z}"). The third field is the time of submission and the fourth field is the result of submission determined by judge Navid. There will be no more than \textbf{100} teams in the contest. \OutputFile Output is a table showing scoreboard and should be in exactly the same form as that in the example below. The widths of the columns are : \begin{itemize} \item Rank : 4 \item Team Name : 12 \item Problem ID : 7 \item Solved : 6 \item Time : 4 \end{itemize} There's a space between consecutive columns. All data in columns are left justified. See the sample output for more details. \includegraphics{https://static.e-olymp.com/content/d5/d59085eedff61319d34507bccf0a33b1cd82e9d2.jpg}
Time limit 1 second
Memory limit 64 MiB
Input example #1
Chormangz/A/00:08/CE
D&C/A/00:10/AC
Chormangz/A/00:14/AC
D&C/C/00:56/WA
D&C/C/01:04/WA
Chormangz/C/01:23/RTE
Chormangz/C/01:27/AC
D&C/B/01:44/AC
Chormangz/B/02:00/WA
Output example #1
Rank Team Name    A       B       C       Solved Time
-----------------------------------------------------
1    D&C          1/10    1/104   2/-     2      114 
2    Chormangz    2/14    1/-     2/87    2      141 
-----------------------------------------------------
Total             3/2     2/1     4/1     4      255