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
Allowed languages
Ada, Assembly, Awk, Brain****, C, C#, C++, COBOL, CommonLisp, D, Dart, F#, Forth, Fortran, Go, Groovy, Haskell, Intercal, Java, JS, Kotlin, Lisp, Lua, Nim, ObjC, OCaml, Octave, Pascal, Perl, PHP, Pike, Prolog, Python, Racket, Ruby, Rust, Scala, Scheme, Sed, Swift, TCL, Text, Turing, VB, Zig

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 Input 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
    Jeffmagma  commented on July 28, 2017, 5:56 p.m.

    I couldn't figure out why was getting 90/100 in this submission, and I kept trying random things and ended up resubmitting the exact same code in a different submission, much later, and I got 100/100. Did anything change with test case 8?


  • 0
    ThePenguinCo  commented on Sept. 10, 2016, 9:36 p.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. 10, 2016, 9:44 p.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;


  • -1
    PaulOlteanu  commented on Dec. 24, 2014, 7:13 p.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?


    • -1
      FatalEagle  commented on Dec. 24, 2014, 7:28 p.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.