TopCoder

Caido
$\mathbb{W}\mathcal{aimai}\sim$

User's AC Ratio

96.7% (29/30)

Submission's AC Ratio

65.7% (46/70)

Tags

Description

Input Format

Output Format

Sample Input 1

5 3
1 2 3 4 5

Sample Output 1

6

Sample Input 2

6 2
2 3 2 3 2 3

Sample Output 2

3

Hints

Problem Source

112 學年度全國資訊學科能力競賽
測資來源:TWPCA GitHub

Subtasks

No. Testdata Range Constraints Score
1 0~1 範例測資 0
2 0, 2~14 $n \le 500$ 且 $c_1, c_2, \ldots, c_n$ 兩兩相異 3
3 0, 2~27 $c_1, c_2, \ldots, c_n$ 兩兩相異 19
4 0~46 無額外限制 78

Testdata and Limits

No. Time Limit (ms) Memory Limit (VSS, KiB) Output Limit (KiB) Subtasks
0 1000 1048576 65536 1 2 3 4
1 1000 1048576 65536 1 4
2 1000 1048576 65536 2 3 4
3 1000 1048576 65536 2 3 4
4 1000 1048576 65536 2 3 4
5 1000 1048576 65536 2 3 4
6 1000 1048576 65536 2 3 4
7 1000 1048576 65536 2 3 4
8 1000 1048576 65536 2 3 4
9 1000 1048576 65536 2 3 4
10 1000 1048576 65536 2 3 4
11 1000 1048576 65536 2 3 4
12 1000 1048576 65536 2 3 4
13 1000 1048576 65536 2 3 4
14 1000 1048576 65536 2 3 4
15 1000 1048576 65536 3 4
16 1000 1048576 65536 3 4
17 1000 1048576 65536 3 4
18 1000 1048576 65536 3 4
19 1000 1048576 65536 3 4
20 1000 1048576 65536 3 4
21 1000 1048576 65536 3 4
22 1000 1048576 65536 3 4
23 1000 1048576 65536 3 4
24 1000 1048576 65536 3 4
25 1000 1048576 65536 3 4
26 1000 1048576 65536 3 4
27 1000 1048576 65536 3 4
28 1000 1048576 65536 4
29 1000 1048576 65536 4
30 1000 1048576 65536 4
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
41 1000 1048576 65536 4
42 1000 1048576 65536 4
43 1000 1048576 65536 4
44 1000 1048576 65536 4
45 1000 1048576 65536 4
46 1000 1048576 65536 4