TopCoder

Caido
$\text{W}ai\text{M}ai\text{QQ}\sim$

User's AC Ratio

88.5% (23/26)

Submission's AC Ratio

41.2% (42/102)

Tags

Description

Input Format

Output Format

Sample Input

// Sample input 1
1
N

// Sample input 2
3
ALG

// Sample input 3
4
ALFQ

Sample Output

// Sample output 1
1

// Sample output 2
9

// Sample output 3
11

Hints

Problem Source

2022 TOI 初選
測資來源:TWPCA GitHub

Subtasks

No. Testdata Range Constraints Score
1 0~2 範例測資。 0
2 3~18 $n \le 20$ 29
3 19~30 所有字母皆與 F 和 J 同一列 30
4 31~40 無額外限制。 41

Testdata and Limits

No. Time Limit (ms) Memory Limit (VSS, KiB) Output Limit (KiB) Subtasks
0 1000 1048576 65536 1
1 1000 1048576 65536 1
2 1000 1048576 65536 1
3 1000 1048576 65536 2
4 1000 1048576 65536 2
5 1000 1048576 65536 2
6 1000 1048576 65536 2
7 1000 1048576 65536 2
8 1000 1048576 65536 2
9 1000 1048576 65536 2
10 1000 1048576 65536 2
11 1000 1048576 65536 2
12 1000 1048576 65536 2
13 1000 1048576 65536 2
14 1000 1048576 65536 2
15 1000 1048576 65536 2
16 1000 1048576 65536 2
17 1000 1048576 65536 2
18 1000 1048576 65536 2
19 1000 1048576 65536 3
20 1000 1048576 65536 3
21 1000 1048576 65536 3
22 1000 1048576 65536 3
23 1000 1048576 65536 3
24 1000 1048576 65536 3
25 1000 1048576 65536 3
26 1000 1048576 65536 3
27 1000 1048576 65536 3
28 1000 1048576 65536 3
29 1000 1048576 65536 3
30 1000 1048576 65536 3
31 1000 1048576 65536 4
32 1000 1048576 65536 4
33 1000 1048576 65536 4
34 1000 1048576 65536 4
35 1000 1048576 65536 4
36 1000 1048576 65536 4
37 1000 1048576 65536 4
38 1000 1048576 65536 4
39 1000 1048576 65536 4
40 1000 1048576 65536 4