TopCoder

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

User's AC Ratio

92.0% (46/50)

Submission's AC Ratio

46.8% (74/158)

Tags

Description

Input Format

Output Format

Sample Input 1

3 2
1 4 6
2 1 2
1 3

Sample Output 1

1 3 2

Sample Input 2

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

Sample Output 2

1 2 3 4

Sample Input 3

4 2
1 4 2 2
3 1 3 2
1 4

Sample Output 3

-1

Hints

Problem Source

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

Subtasks

No. Testdata Range Constraints Score
1 0~2 範例測資。 0
2 3~18 $n \le 9$ 且 $w_i \le 100$。 5
3 19~31 $n \le 18$ 且 $w_i \le 100$。 23
4 32~41 $n \le 100$ 且 $w_i \le 100$。 57
5 42~47 無額外限制。 15

Testdata and Limits

No. Time Limit (ms) Memory Limit (VSS, 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 2
17 1000 131072 65536 2
18 1000 131072 65536 2
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 4
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 5
43 1000 131072 65536 5
44 1000 131072 65536 5
45 1000 131072 65536 5
46 1000 131072 65536 5
47 1000 131072 65536 5