QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#498224#8232. Yet Another Shortest Path QueryHuangHanShengTL 2642ms431732kbC++174.8kb2024-07-30 07:54:312024-07-30 07:54:31

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 1ms
memory: 3540kb

input:

6 9
1 2 4
2 3 6
3 6 5
6 5 3
5 4 2
4 1 3
3 4 9
1 3 100
5 3 1
5
1 3
1 6
3 4
3 5
2 5

output:

6
8
3
1
7

result:

ok 5 number(s): "6 8 3 1 7"

Test #2:

score: 0
Accepted
time: 1ms
memory: 3536kb

input:

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

output:

3
-1
-1

result:

ok 3 number(s): "3 -1 -1"

Test #3:

score: 0
Accepted
time: 584ms
memory: 308888kb

input:

40005 79608
1 2 70031203
1 3 99924845
1 4 61645659
1 5 9324967
2 3 15761918
3 4 62534796
4 5 35260314
5 2 35948540
6 2 23727405
6 7 83302920
7 3 31010426
7 8 75060393
8 4 94275932
8 9 99663793
9 5 81701979
9 6 439297
10 6 46955645
10 11 89514237
11 7 21257310
11 12 53896253
12 8 67933315
12 13 26161...

output:

-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
...

result:

ok 1000000 numbers

Test #4:

score: 0
Accepted
time: 606ms
memory: 330248kb

input:

35479 70156
1 2 53094201
1 3 95796673
1 4 35585979
1 5 55612594
2 3 60766083
3 4 64392832
4 5 32896460
5 2 91649893
6 2 6196154
6 7 4986564
7 3 91799790
7 8 10909791
8 4 30034265
8 9 95672010
9 4 67004237
9 10 77872672
10 5 68900058
10 6 42927604
11 6 71288663
11 12 51597962
12 7 79690815
12 13 9742...

output:

-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
...

result:

ok 1000000 numbers

Test #5:

score: 0
Accepted
time: 625ms
memory: 330028kb

input:

35811 70820
1 2 40434193
1 3 13483892
1 4 32864259
1 5 47591755
1 6 65123023
1 7 81695948
1 8 1102880
1 9 47223939
1 10 52947058
1 11 31439481
2 3 94162364
3 4 20590842
4 5 24137043
5 6 74926235
6 7 9376267
7 8 97130364
8 9 75568799
9 10 5022411
10 11 59066963
11 2 96177033
12 2 17823959
12 13 83906...

output:

-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
...

result:

ok 1000000 numbers

Test #6:

score: 0
Accepted
time: 2493ms
memory: 431732kb

input:

200000 599952
127401 69434 88680591
127401 39916 10673559
127401 52475 59546013
127401 77787 74018113
127401 11462 7023970
60723 37187 65141305
60723 115008 72307785
60723 71812 47362248
60723 143858 20042617
60723 153890 48502784
60723 172009 21754689
60723 23327 97998405
63817 58332 30056889
63817...

output:

-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
...

result:

ok 1000000 numbers

Test #7:

score: 0
Accepted
time: 2357ms
memory: 431708kb

input:

200000 599962
127401 36130 68347938
127401 56107 50001021
127401 35011 47850437
127401 166086 58628679
127401 167575 97121890
127401 150008 97636763
127401 148173 79875436
60723 38275 3780759
60723 75775 69051390
60723 93280 43415633
60723 108525 89666833
60723 119851 80916915
60723 134418 23881201
...

output:

-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
...

result:

ok 1000000 numbers

Test #8:

score: 0
Accepted
time: 2642ms
memory: 429576kb

input:

200000 599957
127401 62215 44179748
127401 96198 78839479
127401 81659 96992357
127401 105920 13674618
127401 192829 54389653
60723 66329 69331527
60723 139474 14904280
60723 186870 86233097
60723 134036 31587848
60723 161658 81495543
60723 156381 83635122
60723 187612 77920441
60723 189714 55041890...

output:

-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
...

result:

ok 1000000 numbers

Test #9:

score: 0
Accepted
time: 597ms
memory: 300632kb

input:

35011 70019
1 2 65752645
2 3 52997572
3 4 14100539
4 5 78562579
5 6 99655664
6 7 26904774
7 8 88411503
8 9 89420520
9 10 88149169
10 11 53207001
11 12 16506048
12 13 37143703
13 14 1295901
14 15 61139259
15 16 79880287
16 17 4390087
17 18 2733598
18 19 48969502
19 20 77562639
20 21 53171540
21 22 36...

output:

-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
...

result:

ok 1000000 numbers

Test #10:

score: 0
Accepted
time: 641ms
memory: 293788kb

input:

50000 99997
1 2 5460409
2 3 95815999
3 4 17091945
4 5 91580749
5 6 91717493
6 7 55420828
7 8 10603109
8 9 62048169
9 10 28446542
10 11 38346952
11 12 66167473
12 13 80749600
13 14 20348320
14 15 5868535
15 16 45627426
16 17 2445360
17 18 21766361
18 19 20516369
19 20 8226530
20 21 86609482
21 22 134...

output:

-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
...

result:

ok 1000000 numbers

Test #11:

score: -100
Time Limit Exceeded

input:

50000 99997
1 2 92917899
2 3 90125226
3 4 10806409
4 5 56452040
5 6 34960749
6 7 14085023
7 8 96350028
8 9 49181182
9 10 70920046
10 11 3727766
11 12 42039112
12 13 63921049
13 14 7634090
14 15 24597384
15 16 13087802
16 17 63136838
17 18 58806049
18 19 98769520
19 20 943620
20 21 70246129
21 22 145...

output:


result: