#P11154. 【MX-X6-T0】Arcaea Scoring System

【MX-X6-T0】Arcaea Scoring System

Background

Original link: https://oier.team/problems/X6A

Problem 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 nn notes, the base score is 10710^7 points, and the bonus score is nn points, so the maximum score is 107+n10^7 + n points. Each note is worth 107n\dfrac{10^7}{n} points of base score and 11 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 9.9×106\geq 9.9\times 10^6, the rating is EX+.
  • If the play score 9.8×106\geq 9.8\times 10^6 and <9.9×106< 9.9\times 10^6, the rating is EX.
  • If the play score 9.5×106\geq 9.5\times 10^6 and <9.8×106< 9.8\times 10^6, the rating is AA.
  • If the play score 9.2×106\geq 9.2\times 10^6 and <9.5×106< 9.5\times 10^6, the rating is A.
  • If the play score 8.9×106\geq 8.9\times 10^6 and <9.2×106< 9.2\times 10^6, the rating is B.
  • If the play score 8.6×106\geq 8.6\times 10^6 and <8.9×106< 8.9\times 10^6, the rating is C.
  • If the play score <8.6×106< 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 p1,p0,f,lp_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=p1+p0+f+ln = 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.

44 0 0 0
EX+
33 10 0 1
AA
0 0 0 1
D

Hint

Sample Explanation #1

All notes are judged as Perfect Pure, so the player gets the full base score 10710^7 and all bonus score. Since there are 4444 notes in total, the player additionally gets 4444 points, so the play score is 10,000,04410{,}000{,}044. The total score is at least 9.9×1069.9\times 10^6, so the rating is EX+.

Sample Explanation #2

The number of notes is 33+10+0+1=4433 + 10 + 0 + 1 = 44. Among them, 3333 notes are judged as Perfect Pure, 1010 as Normal Pure, and 11 as Lost. Therefore, the player gets 4344×107\dfrac{43}{44} \times 10^7 base score and 3333 bonus points. The total is 9,772,760.2˙7˙9{,}772{,}760.\dot 2 \dot 7, and the play score is floored to 9,772,7609{,}772{,}760. The total score is at least 9.5×1069.5\times 10^6 and less than 9.8×1069.8\times 10^6, so the rating is AA.

Constraints

For all data, p0,p1,f,l0p_0, p_1, f, l \geq 0, and 1n1001 \leq n \leq 100.

There are 1010 test cases in total. For the first 22 test cases, n=1n = 1 is guaranteed.

Translated by ChatGPT 5