TopCoder

JiKuai
我媽菈米好可愛>< \EMT我婆/

User's AC Ratio

86.5% (45/52)

Submission's AC Ratio

26.1% (91/348)

Tags

Description

Input Format

Output Format

Sample Input 1

4
6 0 1 2
1 0 4 2
4 0 1 3
2 0 0 3

Sample Output 1

7

Sample Input 2

4
2 3 2 10
3 5 1 20
6 4 4 30
7 2 0 40

Sample Output 2

70

Hints

Problem Source

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

Subtasks

No. Testdata Range Constraints Score
1 0~1 範例測資。 0
2 2~13 $n \le 3000$。 13
3 14~24 $n \le 5 \times 10 ^ 4$。 21
4 25~30 無額外限制。 66

Testdata and Limits

No. Time Limit (ms) Memory Limit (VSS, KiB) Output Limit (KiB) Subtasks
0 2300 131072 65536 1
1 2300 131072 65536 1
2 2300 131072 65536 2
3 2300 131072 65536 2
4 2300 131072 65536 2
5 2300 131072 65536 2
6 2300 131072 65536 2
7 2300 131072 65536 2
8 2300 131072 65536 2
9 2300 131072 65536 2
10 2300 131072 65536 2
11 2300 131072 65536 2
12 2300 131072 65536 2
13 2300 131072 65536 2
14 2300 131072 65536 3
15 2300 131072 65536 3
16 2300 131072 65536 3
17 2300 131072 65536 3
18 2300 131072 65536 3
19 2300 131072 65536 3
20 2300 131072 65536 3
21 2300 131072 65536 3
22 2300 131072 65536 3
23 2300 131072 65536 3
24 2300 131072 65536 3
25 2300 131072 65536 4
26 2300 131072 65536 4
27 2300 131072 65536 4
28 2300 131072 65536 4
29 2300 131072 65536 4
30 2300 131072 65536 4