TopCoder

Caido
主唱太拼命了

User's AC Ratio

100.0% (6/6)

Submission's AC Ratio

91.7% (11/12)

Tags

Description

Input Format

Output Format

Sample Input 1

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

Sample Output 1

2
6
4
10
20

Sample Input 2

1000000 10
1 21586 928842
1 619334 853861
2 274417 572426
1 239830 413748
2 79123 839131
1 2410 978513
2 350282 605034
1 22256 122739
1 463714 491706
1 588774 892375

Sample Output 2

205779269641
205779269641
47739274528
70206420196
2839716097
238195242756
65125733632
65125733632
65321649641
68424333811

Hints

Problem Source

YTP 2023 國中組程式挑戰營 p7

Subtasks

No. Testdata Range Constraints Score
1 0~1 範例測資 0
2 0~24 無額外限制 15

Testdata and Limits

No. Time Limit (ms) Memory Limit (VSS, KiB) Output Limit (KiB) Subtasks
0 3000 524288 65536 1 2
1 3000 524288 65536 1 2
2 3000 524288 65536 2
3 3000 524288 65536 2
4 3000 524288 65536 2
5 3000 524288 65536 2
6 3000 524288 65536 2
7 3000 524288 65536 2
8 3000 524288 65536 2
9 3000 524288 65536 2
10 3000 524288 65536 2
11 3000 524288 65536 2
12 3000 524288 65536 2
13 3000 524288 65536 2
14 3000 524288 65536 2
15 3000 524288 65536 2
16 3000 524288 65536 2
17 3000 524288 65536 2
18 3000 524288 65536 2
19 3000 524288 65536 2
20 3000 524288 65536 2
21 3000 524288 65536 2
22 3000 524288 65536 2
23 3000 524288 65536 2
24 3000 524288 65536 2