QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#429421#438. 美食家SimonLJK100 ✓844ms32604kbC++202.0kb2024-06-02 14:44:242024-06-02 14:44:25

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 5
Accepted
time: 8ms
memory: 30544kb

input:

3 5 5 2
9 99 141
1 2 1
2 3 2
3 1 2
1 3 1
1 3 2
4 2 546192273
5 1 6172

output:

6430

result:

ok answer is '6430'

Test #2:

score: 5
Accepted
time: 9ms
memory: 31860kb

input:

4 7 5 2
62 371 208 312
1 2 1
2 3 2
3 4 1
4 1 1
2 4 2
3 4 2
1 4 1
4 4 13094
3 3 33899

output:

48008

result:

ok answer is '48008'

Test #3:

score: 5
Accepted
time: 6ms
memory: 31720kb

input:

5 12 5 3
171 1 1627 14 3959
1 2 3
2 3 1
3 4 2
4 5 3
5 1 3
1 2 3
2 4 2
2 4 2
5 1 3
2 5 3
4 2 3
5 3 2
2 1 61934
4 2 20655
3 4 52501

output:

-1

result:

ok answer is '-1'

Test #4:

score: 5
Accepted
time: 6ms
memory: 31876kb

input:

5 12 5 3
19 198 196 250 2129
1 2 2
2 3 2
3 4 1
4 5 1
5 1 2
2 5 1
5 2 2
2 5 2
4 1 2
2 4 2
3 1 2
4 5 1
4 3 69347
5 2 15485
3 5 52501

output:

54866

result:

ok answer is '54866'

Test #5:

score: 5
Accepted
time: 196ms
memory: 32140kb

input:

25 45 52497 185
781 50 344 27 238 816 699 683 322 300 7 708 8016 1933 524 2206 7138 540 2685 18266 189 1585 3401 21085 6529
1 2 5
2 3 5
3 4 2
4 5 4
5 6 4
6 7 3
7 8 4
8 9 5
9 10 3
10 11 3
11 12 3
12 13 1
13 14 5
14 15 2
15 16 1
16 17 2
17 18 1
18 19 4
19 20 1
20 21 4
21 22 2
22 23 4
23 24 4
24 25 3
2...

output:

19100096713

result:

ok answer is '19100096713'

Test #6:

score: 5
Accepted
time: 209ms
memory: 31856kb

input:

25 45 52501 186
77 297 468 52 308 370 2572 101 1399 5099 42 3 828 1634 1060 701 3144 3094 3726 982 2435 2528 2264 18084 2423
1 2 2
2 3 5
3 4 3
4 5 1
5 6 4
6 7 3
7 8 3
8 9 1
9 10 4
10 11 3
11 12 4
12 13 1
13 14 3
14 15 4
15 16 5
16 17 2
17 18 5
18 19 2
19 20 2
20 21 1
21 22 2
22 23 2
23 24 2
24 25 2
...

output:

16261622399

result:

ok answer is '16261622399'

Test #7:

score: 5
Accepted
time: 255ms
memory: 32088kb

input:

35 50 52497 187
474 273 85 203 627 261 76 1970 1523 5280 1406 970 3977 1371 1161 2524 684 719 852 2877 1998 3540 846 2082 9946 570 8917 2947 19161 3624 3200 3022 1786 1621 5078
1 2 1
2 3 3
3 4 1
4 5 2
5 6 2
6 7 1
7 8 2
8 9 1
9 10 1
10 11 5
11 12 1
12 13 5
13 14 2
14 15 5
15 16 5
16 17 3
17 18 1
18 1...

output:

16727334141

result:

ok answer is '16727334141'

Test #8:

score: 5
Accepted
time: 186ms
memory: 32416kb

input:

20 40 52497 185
49 289 88 678 41 299 1326 194 622 1527 9216 1515 401 352 2350 1809 1092 5017 1820 1812
1 2 5
2 3 5
3 4 5
4 5 5
5 6 4
6 7 3
7 8 3
8 9 5
9 10 4
10 11 2
11 12 4
12 13 2
13 14 4
14 15 5
15 16 1
16 17 1
17 18 2
18 19 3
19 20 5
20 1 2
1 9 2
8 14 1
4 16 1
2 12 4
1 14 2
14 9 5
18 9 4
13 4 5
...

output:

17017559829

result:

ok answer is '17017559829'

Test #9:

score: 5
Accepted
time: 400ms
memory: 32564kb

input:

45 45 999999474 187
172 770 127 321 2616 499 5851 4338 1129 377 106 1365 1195 703 1332 3066 645 1950 12782 3900 376 11640 220 2574 8777 3059 3059 18567 748 24887 20621 1002 361 11 5345 34362 11404 16476 2218 20221 4008 5087 1022 21615 41579
1 2 4
2 3 2
3 4 3
4 5 5
5 6 5
6 7 5
7 8 3
8 9 1
9 10 2
10 1...

output:

2192904771297

result:

ok answer is '2192904771297'

Test #10:

score: 5
Accepted
time: 410ms
memory: 31860kb

input:

50 50 999999972 188
166 387 401 159 479 183 1211 1271 1581 615 2057 669 432 2821 2814 2632 1695 7751 2260 2722 996 3686 1555 631 13221 3853 407 1665 3020 607 5855 3698 4153 3417 4299 6531 4710 1289 10317 6013 4404 1774 32428 261 31197 4274 5181 6124 4563 5333
1 2 3
2 3 5
3 4 5
4 5 3
5 6 2
6 7 2
7 8 ...

output:

1306756880996

result:

ok answer is '1306756880996'

Test #11:

score: 5
Accepted
time: 53ms
memory: 31904kb

input:

30 45 964010246 0
50 5 1364 669 913 1084 284 7529 1448 486 1208 11208 1281 2565 2974 9101 570 2792 2539 542 15806 2403 4516 2641 4873 1056 5131 24290 4312 5867
1 2 3
2 3 3
3 4 4
4 5 4
5 6 2
6 7 4
7 8 3
8 9 3
9 10 3
10 11 4
11 12 5
12 13 3
13 14 5
14 15 2
15 16 1
16 17 5
17 18 3
18 19 3
19 20 3
20 21...

output:

2502418347081

result:

ok answer is '2502418347081'

Test #12:

score: 5
Accepted
time: 80ms
memory: 31900kb

input:

35 50 990789960 0
44 213 166 80 3022 487 649 616 475 1141 795 102 1132 194 289 1055 1173 1477 10494 17252 421 280 2578 640 1214 691 2595 4528 8182 4506 13146 4643 2740 26836 5968
1 2 1
2 3 1
3 4 4
4 5 5
5 6 4
6 7 4
7 8 4
8 9 3
9 10 1
10 11 4
11 12 4
12 13 4
13 14 1
14 15 5
15 16 5
16 17 1
17 18 5
18...

output:

4194426729874

result:

ok answer is '4194426729874'

Test #13:

score: 5
Accepted
time: 50ms
memory: 31944kb

input:

30 45 939748758 0
130 138 428 236 203 654 1071 592 1719 518 1375 1254 924 2172 2880 6255 3011 2688 17400 1383 708 4255 3929 13855 8364 343 247 7003 2380 3307
1 2 3
2 3 5
3 4 2
4 5 1
5 6 1
6 7 3
7 8 2
8 9 3
9 10 4
10 11 2
11 12 5
12 13 4
13 14 1
14 15 1
15 16 4
16 17 1
17 18 3
18 19 2
19 20 4
20 21 4...

output:

1736300115608

result:

ok answer is '1736300115608'

Test #14:

score: 5
Accepted
time: 77ms
memory: 32144kb

input:

30 50 978105877 10
21 93 486 741 104 980 322 542 1377 33 911 30 1786 9715 2553 2621 317 397 751 2991 7586 3423 3280 21465 3271 2739 3684 3760 4484 5435
1 2 3
2 3 5
3 4 2
4 5 5
5 6 4
6 7 1
7 8 2
8 9 5
9 10 1
10 11 1
11 12 2
12 13 1
13 14 5
14 15 4
15 16 4
16 17 4
17 18 1
18 19 3
19 20 1
20 21 1
21 22...

output:

1746483071396

result:

ok answer is '1746483071396'

Test #15:

score: 5
Accepted
time: 77ms
memory: 32604kb

input:

30 50 900969268 10
37 379 526 182 173 732 1319 3040 4688 6301 163 472 2590 10857 383 2887 1084 1734 3094 3093 2626 385 21941 1065 2731 1302 5225 2592 1460 2978
1 2 5
2 3 2
3 4 4
4 5 5
5 6 1
6 7 1
7 8 4
8 9 1
9 10 4
10 11 4
11 12 3
12 13 1
13 14 1
14 15 5
15 16 5
16 17 2
17 18 5
18 19 4
19 20 4
20 21...

output:

1147285073996

result:

ok answer is '1147285073996'

Test #16:

score: 5
Accepted
time: 505ms
memory: 31204kb

input:

35 50 932365859 196
98 32 189 289 340 194 568 856 298 126 559 1732 703 1534 10331 2934 1843 7175 17558 1069 3912 3620 156 3765 893 4210 9491 4325 1514 14716 775 276 1197 4808 2370
1 2 3
2 3 1
3 4 3
4 5 2
5 6 2
6 7 2
7 8 3
8 9 3
9 10 5
10 11 1
11 12 2
12 13 3
13 14 4
14 15 5
15 16 4
16 17 2
17 18 3
1...

output:

1458164877593

result:

ok answer is '1458164877593'

Test #17:

score: 5
Accepted
time: 544ms
memory: 31936kb

input:

39 50 974099211 197
160 50 1719 3731 943 334 630 467 520 882 2646 1444 658 1260 2529 1540 707 1378 11561 3983 1997 867 929 927 1436 892 23201 5345 4742 648 5695 4826 28546 5661 4346 28984 2133 5860 760
1 2 1
2 3 1
3 4 3
4 5 4
5 6 4
6 7 3
7 8 3
8 9 4
9 10 1
10 11 4
11 12 1
12 13 5
13 14 2
14 15 5
15 ...

output:

3547211642863

result:

ok answer is '3547211642863'

Test #18:

score: 5
Accepted
time: 834ms
memory: 31276kb

input:

50 501 998244353 199
33 49 418 315 699 556 1015 461 92 556 6796 896 997 126 7777 924 3278 1291 1671 207 1767 20414 160 21663 2663 1402 3827 3595 5349 1916 3178 2921 2669 2412 18078 5915 492 6362 7669 724 4678 1143 2330 2826 32591 4146 6453 46589 8544 869
8 19 4
4 48 4
6 45 3
1 40 2
21 27 3
1 28 3
28...

output:

9849899673519

result:

ok answer is '9849899673519'

Test #19:

score: 5
Accepted
time: 844ms
memory: 32044kb

input:

50 501 997163873 199
33 49 418 315 699 556 1015 461 92 556 6796 896 997 126 7777 924 3278 1291 1671 207 1767 20414 160 21663 2663 1402 3827 3595 5349 1916 3178 2921 2669 2412 18078 5915 492 6362 7669 724 4678 1143 2330 2826 32591 4146 6453 46589 8544 869
8 19 4
4 48 4
6 45 3
1 40 2
21 27 3
1 28 3
28...

output:

9838255244438

result:

ok answer is '9838255244438'

Test #20:

score: 5
Accepted
time: 835ms
memory: 32324kb

input:

50 501 943934719 200
162 53 261 3878 65 1169 80 1380 1406 1268 8289 1775 521 13496 439 2560 1640 117 3129 335 1881 3958 2407 19027 464 10169 3069 4249 3051 4569 700 12963 7923 3343 3306 8291 3756 1751 6860 4089 488 3935 8355 6185 42968 8661 3604 39456 9036 47170
28 45 3
3 18 4
7 43 4
8 41 3
40 46 1
...

output:

10464274815267

result:

ok answer is '10464274815267'

Extra Test:

score: 0
Extra Test Passed