DMOPC '14 Contest 3 P2 - Not Enough Rejudging!

View as PDF

Submit solution


Points: 5 (partial)
Time limit: 2.0s
Memory limit: 64M

Author:
Problem type

Amagi Brilliant Contests runs a business making and hosting contests on its online platform to competitive programmers who want to run their own contests.

From their last contest, ABC has some submissions they need to rejudge to ensure an accurate score. The N submissions each have their own status code. The four types of status codes that occurred during the contest were AC, WA, TLE, and IR.

When the submissions are rejudged, all of the existing AC will stay AC; the first 30\% (rounded down) WA will turn to AC and the rest will stay WA; all existing TLE will turn to WA; and up to the first 10 IR will turn to AC, up to the next 10 will turn to WA, and the rest will stay IR.

You are the head of the technical troubleshooting department at Amagi Brilliant Contests, and so you have been tasked with determining the final list of status codes after rejudging (the initial list is given in order of rejudging).

Constraints

1 \le N \le 1\,000

Input Specification

The first line of input will have N, the number of status codes.

The next N lines of input will each contain a status code in the order that they are rejudged. A status code is guaranteed to be one of AC, WA, TLE, or IR.

Output Specification

There should be N lines of output, each containing the new status code of the corresponding submission after rejudging, in the order they are rejudged.

Sample Input 1

4
AC
AC
TLE
IR

Sample Output 1

AC
AC
WA
AC

Explanation for Sample Output 1

The first two ACs stayed the same, the TLE turned to WA, and the IR turned to AC.

Sample Input 2

21
IR
IR
IR
WA
IR
WA
IR
IR
IR
IR
WA
IR
IR
WA
IR
WA
IR
IR
IR
WA
IR

Sample Output 2

AC
AC
AC
AC
AC
WA
AC
AC
AC
AC
WA
AC
AC
WA
WA
WA
WA
WA
WA
WA
WA

Comments


  • 1
    ThePenguinCo  commented on Sept. 11, 2016, 1:36 a.m. edit 2

    The statement: "the first 30% (rounded down) WA will turn to AC" is a little bit misleading. Do you mean the first 30% of submissions or first 30% of WA submissions?


    • 1
      Phoenix1369  commented on Sept. 11, 2016, 1:44 a.m.

      Though the statement could be made more clear, it is not ambiguous.

      You know that it is the first 30\% of WA submissions because the rest of the sentence goes:

      and the rest will stay WA;


  • 0
    PaulOlteanu  commented on Dec. 25, 2014, 12:13 a.m.

    I didn't understand why my submissions were slower than BobHob's, so I copy and pasted his and submitted it, and it was as slow as mine (0.5), yet it says his submission was 0.3.

    Does the judging change after the contest is over?


    • 0
      FatalEagle  commented on Dec. 25, 2014, 12:28 a.m.

      The times are only a rough guideline. There are multiple judges, and each may be slightly faster/slower than the others. However, for most problems it is guaranteed that a correct solution will not time out on all the judges it can be judged on.