TopCoder

User's AC Ratio

80.0% (4/5)

Submission's AC Ratio

22.2% (4/18)

Tags

Description

Input Format

Output Format

Sample Input 1

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

Sample Output 1

4

Sample Input 2

7 10
6 7 9 4 8 5 5
3 7 6 9 9 1 5

Sample Output 2

5

Hints

Problem Source

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

Subtasks

No. Testdata Range Constraints Score
1 0~1 範例測資 0
2 0~12 $n \le 100, P \le 100$ 5
3 0~22 $n \le 100, P \le 10000$ 7
4 0~37 $n \le 5000$ 17
5 38~47 對於所有 $i$,$b_i \le a_i$ 40
6 0~60 無額外限制 31

Testdata and Limits

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