TopCoder

Thumb vi punching
Caido
$\text{W}ai\text{M}ai\sim$

User's AC Ratio

100.0% (4/4)

Submission's AC Ratio

36.8% (7/19)

Description

Input Format

Output Format

Sample Input

// Sample input 1
4
2 2 3 5
1 1 7 2
4 1 1 1

// Sample input 2
3
4 3 3
1 7 2
2 3 1

// Sample input 3
5
1 1 9 1 4
3 3 2 5 2
7 1 2 1 2

Sample Output

// Sample output 1
10

// Sample output 2
9

// Sample output 3
14

Hints

Problem Source

109 學年度全國資訊學科能力競賽

Subtasks

No. Testdata Range Constraints Score
1 0~2 範例測資。 0
2 3~15 $n \le 20$。 9
3 16~32 $n \le 3000$。 17
4 33~54 無額外限制。 74

Testdata and Limits

No. Time Limit (ms) Memory Limit (KiB) Output Limit (KiB) Subtasks
0 1000 131072 65536 1
1 1000 131072 65536 1
2 1000 131072 65536 1
3 1000 131072 65536 2
4 1000 131072 65536 2
5 1000 131072 65536 2
6 1000 131072 65536 2
7 1000 131072 65536 2
8 1000 131072 65536 2
9 1000 131072 65536 2
10 1000 131072 65536 2
11 1000 131072 65536 2
12 1000 131072 65536 2
13 1000 131072 65536 2
14 1000 131072 65536 2
15 1000 131072 65536 2
16 1000 131072 65536 3
17 1000 131072 65536 3
18 1000 131072 65536 3
19 1000 131072 65536 3
20 1000 131072 65536 3
21 1000 131072 65536 3
22 1000 131072 65536 3
23 1000 131072 65536 3
24 1000 131072 65536 3
25 1000 131072 65536 3
26 1000 131072 65536 3
27 1000 131072 65536 3
28 1000 131072 65536 3
29 1000 131072 65536 3
30 1000 131072 65536 3
31 1000 131072 65536 3
32 1000 131072 65536 3
33 1000 131072 65536 4
34 1000 131072 65536 4
35 1000 131072 65536 4
36 1000 131072 65536 4
37 1000 131072 65536 4
38 1000 131072 65536 4
39 1000 131072 65536 4
40 1000 131072 65536 4
41 1000 131072 65536 4
42 1000 131072 65536 4
43 1000 131072 65536 4
44 1000 131072 65536 4
45 1000 131072 65536 4
46 1000 131072 65536 4
47 1000 131072 65536 4
48 1000 131072 65536 4
49 1000 131072 65536 4
50 1000 131072 65536 4
51 1000 131072 65536 4
52 1000 131072 65536 4
53 1000 131072 65536 4
54 1000 131072 65536 4