Gahee and Club Audition 1
Time limit1sMemory limit512 MB
Given a key note level and its judgement, compute the score when the judgement differs from the previous one, so a perfect starts a 1-chain.
- Level
Easy2 of 10
- Topics
- Implementation
- Solved
- No attempts yet
Problem
Gahee plays a club audition game. The game has several modes, and Gahee plays the 8-key mode. The 8-key mode has key notes with level 6 or higher. A key note of level has keys. Each key points in one of 8 directions: up, down, left, right, up-left, down-left, up-right, or down-right.

[Figure 1] A key note of level 6
[Figure 1] has four pictures. Yellow marks a key that has already been pressed, and blue marks a key that must be pressed. For example, the upper right picture in Figure 1 means the keys must be pressed in the order down-left, right, up-right, down.
The upper left picture in the first row shows the moment right after a level 6 key note appears. The upper right picture shows the state 1/4 of the timing after the note appears. The lower left picture shows the state 1/2 of the timing after the note appears, and by then all six keys have been pressed. The lower right picture shows Gahee pressing the Space key on the timing and earning a perfect judgement.
Each key note receives a judgement. Two cases produce a miss judgement:
- Fewer than directions were entered correctly.
- The Space key was not pressed, or it was pressed but the timing was off.
Otherwise, the judgement is one of bad, cool, great, or perfect. A perfect judgement also has one more state, the -chain (n-pack). The -chain is the state of receiving perfect judgements in a row. When a key note gets a perfect judgement:
- If the previous judgement was not perfect, the state is a 1-chain.
- If the previous judgement was perfect and the state was a -chain, the state becomes a -chain.
The score for a key note of level depends on its judgement:
- miss gives 0 points.
- bad gives times points.
- cool gives times points.
- great gives times points.
- perfect in an -chain gives times points.
The level and the judgement of a key note that Gahee hit are given. Find the score Gahee earned when the judgement is different from the one Gahee received before.
Input
The first line contains the level of the key note and the judgement, separated by a space. The judgement is one of miss, bad, cool, great, or perfect.
Output
Print the score Gahee earned.