P11154 [MX-X6-T0] Arcaea Scoring System

Background

Original link: 。

Description

Arcaea is a music game popular worldwide, well known for its innovative 3D playing interface. In Arcaea, players tap/slide the screen to play the chart along with the rhythm. The scoring rules for one chart play are as follows. - A chart contains several **notes**. Each note has one of four judgment results: **Perfect Pure**, **Normal Pure**, **Far**, **Lost**. - For a chart with $n$ notes, the **base score** is $10^7$ points, and the **bonus score** is $n$ points, so the maximum score is $10^7 + n$ points. Each note is worth $\dfrac{10^7}{n}$ points of **base score** and $1$ point of **bonus score**. - If a note gets a **Perfect Pure**, the player gets all base score and bonus score of that note. - If a note gets a **Normal Pure**, the player gets all base score of that note, but does not get the bonus score. - If a note gets a **Far**, the player gets only half of the base score of that note. - If a note gets a **Lost**, the player gets no points. - The play score is the floor of the sum of the points obtained from all notes. Based on the score, the player also gets a **rating**. - If the play score $\geq 9.9\times 10^6$, the rating is **EX+**. - If the play score $\geq 9.8\times 10^6$ and $< 9.9\times 10^6$, the rating is **EX**. - If the play score $\geq 9.5\times 10^6$ and $< 9.8\times 10^6$, the rating is **AA**. - If the play score $\geq 9.2\times 10^6$ and $< 9.5\times 10^6$, the rating is **A**. - If the play score $\geq 8.9\times 10^6$ and $< 9.2\times 10^6$, the rating is **B**. - If the play score $\geq 8.6\times 10^6$ and $< 8.9\times 10^6$, the rating is **C**. - If the play score $< 8.6\times 10^6$, the rating is **D**. Now you are given the counts of the four judgment results for a chart play. Please compute the rating for this play.

Input Format

One line with four integers $p_1, p_0, f, l$ separated by spaces, representing the counts of **Perfect Pure**, **Normal Pure**, **Far**, **Lost**, respectively. The total number of notes is $n = p_1 + p_0 + f + l$.

Output Format

Output a string representing the rating. The seven ratings should be printed as `EX+`, `EX`, `AA`, `A`, `B`, `C`, `D`, respectively.

Explanation/Hint

**Sample Explanation #1** All notes are judged as Perfect Pure, so the player gets the full base score $10^7$ and all bonus score. Since there are $44$ notes in total, the player additionally gets $44$ points, so the play score is $10{,}000{,}044$. The total score is at least $9.9\times 10^6$, so the rating is EX+. **Sample Explanation #2** The number of notes is $33 + 10 + 0 + 1 = 44$. Among them, $33$ notes are judged as Perfect Pure, $10$ as Normal Pure, and $1$ as Lost. Therefore, the player gets $\dfrac{43}{44} \times 10^7$ base score and $33$ bonus points. The total is $9{,}772{,}760.\dot 2 \dot 7$, and the play score is floored to $9{,}772{,}760$. The total score is at least $9.5\times 10^6$ and less than $9.8\times 10^6$, so the rating is AA. **Constraints** For all data, $p_0, p_1, f, l \geq 0$, and $1 \leq n \leq 100$. There are $10$ test cases in total. For the first $2$ test cases, $n = 1$ is guaranteed. Translated by ChatGPT 5