#P9254. [PA 2022] Liczenie punktów
[PA 2022] Liczenie punktów
Problem Description
This problem is translated from PA 2022 Round 1 Liczenie punktów.
The judges of PA are tired of constantly calculating the scores for all submitted programs. Please help them automate this process.
For each problem, one submission can score from to points. There are groups of testdata for a problem, and is divisible by . If the program passes the first groups, it gets point. If it also passes the next groups, it gets another point, and so on. A submission earns point independently for each block of testdata groups that it passes completely. If there is an error in any group inside a block, then the submission gets points for that block.
Notes:
- For simplicity, we assume that each block contains the same number of testdata groups, but in real programming contests this is not always the case.
- Any code you have written may be used to mess with you (the astronaut joke).
Input Format
The first line contains an integer , where is a multiple of , representing the number of testdata groups.
The next line contains a string of length consisting only of T and N, describing the pass/fail result of each testdata group. T means the group is passed, and N means the group is not passed.
Output Format
Output one integer on a single line, representing the score of this submission.
20
TTNNTTNTNTNNNNNNNNTT
3
Hint
For of the data, it holds that:
。
Translated by ChatGPT 5