QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#403253#6215. 轻重路径dXqwq100 ✓703ms19420kbC++231.7kb2024-05-02 00:06:042024-05-02 00:06:04

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 10
Accepted
time: 1ms
memory: 3836kb

input:

10
6 2
7 3
4 8
9 5
10 0
0 0
0 0
0 0
0 0
0 0
9
7 10 9 6 5 4 8 3 2

output:

24
24
14
14
14
9
13
5
2
0

result:

ok 10 lines

Test #2:

score: 10
Accepted
time: 2ms
memory: 3844kb

input:

900
12 2
3 13
4 14
5 15
16 6
7 17
18 8
19 9
10 20
21 11
22 24
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
23 27
28 26
25 33
29 31
50 36
30 39
104 34
35 32
37 38
46 47
62 116
57 70
98 139
43 44
41 42
295 129
72 67
40 59
45 187
48 65
56 54
123 52
49 68
250 288
132 75
51 79
55 89
81 61
0 94
111 74
386 53
5...

output:

268205
267880
267406
267330
267330
266501
265769
265769
265769
265769
265025
265025
265025
265025
265025
265025
265025
265025
265025
265031
264144
263264
263264
262555
262555
262555
261898
261218
261316
260463
259813
259632
259632
259632
258857
258995
258371
258371
258371
258371
257586
256766
256766...

result:

ok 900 lines

Test #3:

score: 10
Accepted
time: 2ms
memory: 3788kb

input:

1000
2 22
23 3
4 24
25 5
26 6
7 27
8 28
9 29
30 10
11 31
32 12
13 33
14 34
15 35
36 16
17 37
18 38
39 19
40 20
41 21
42 44
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
45 43
60 59
47 48
50 46
72 168
57 51
49 53
55 54
671 0
52 56
85 103
62 107
58 93
71 74
61 66
137 ...

output:

327054
327054
326467
325853
325192
324378
323622
323622
323622
323574
322634
322634
321675
320745
320745
319876
319680
319680
319680
319680
319680
319079
319079
319104
318125
318125
317327
317499
316682
315873
315873
315965
315965
315965
315965
315965
315283
314653
314127
313392
313413
313413
312420...

result:

ok 1000 lines

Test #4:

score: 10
Accepted
time: 126ms
memory: 8056kb

input:

50000
10002 2
10003 3
10004 4
10005 5
6 10006
10007 7
8 10008
9 10009
10010 10
11 10011
12 10012
13 10013
14 10014
10015 15
10016 16
10017 17
18 10018
10019 19
10020 20
10021 21
22 10022
10023 23
24 10024
25 10025
10026 26
10027 27
10028 28
29 10029
10030 30
10031 31
10032 32
10033 33
10034 34
10035...

output:

711872301
711872301
711872301
711832923
711832923
711832923
711832923
711792238
711792238
711807464
711770275
711770275
711770275
711770275
711770275
711770275
711770275
711770275
711770275
711770275
711730717
711730717
711730717
711730717
711730717
711683529
711683529
711683529
711683529
711683529
...

result:

ok 48001 lines

Test #5:

score: 10
Accepted
time: 126ms
memory: 7868kb

input:

50000
10002 2
10003 3
10004 4
5 10005
6 10006
7 10007
8 10008
10009 9
10010 10
11 10011
10012 12
10013 13
10014 14
10015 15
16 10016
10017 17
10018 18
19 10019
20 10020
21 10021
22 10022
23 10023
24 10024
10025 25
26 10026
10027 27
10028 28
29 10029
10030 30
31 10031
32 10032
33 10033
34 10034
35 10...

output:

708802150
708802150
708802150
708807841
708807841
708807841
708807841
708807841
708807841
708807841
708807841
708807841
708807841
708758166
708758166
708758166
708758218
708758218
708715881
708715881
708715881
708715881
708715881
708667294
708667294
708667294
708667294
708618528
708579105
708579105
...

result:

ok 50000 lines

Test #6:

score: 10
Accepted
time: 288ms
memory: 11568kb

input:

100000
2 10002
10003 3
10004 4
10005 5
10006 6
10007 7
8 10008
10009 9
10010 10
11 10011
10012 12
10013 13
10014 14
15 10015
16 10016
10017 17
18 10018
19 10019
20 10020
21 10021
22 10022
10023 23
10024 24
25 10025
10026 26
27 10027
28 10028
29 10029
10030 30
31 10031
10032 32
33 10033
10034 34
35 1...

output:

3109461726
3109440696
3109351193
3109351193
3109351193
3109351193
3109259093
3109187430
3109155293
3109155293
3109155293
3109155293
3109058706
3109058706
3109042061
3108950464
3108941665
3108941665
3108941665
3108846324
3108846324
3108757770
3108661321
3108596978
3108596978
3108623997
3108623997
310...

result:

ok 99998 lines

Test #7:

score: 10
Accepted
time: 290ms
memory: 11560kb

input:

100000
10002 2
3 10003
10004 4
5 10005
6 10006
10007 7
8 10008
9 10009
10 10010
10011 11
12 10012
10013 13
10014 14
15 10015
10016 16
17 10017
18 10018
19 10019
10020 20
10021 21
10022 22
10023 23
24 10024
10025 25
10026 26
10027 27
10028 28
29 10029
30 10030
31 10031
32 10032
33 10033
10034 34
1003...

output:

3091424929
3091424929
3091424929
3091411418
3091411418
3091411418
3091406154
3091321840
3091321840
3091261927
3091261927
3091261927
3091258651
3091258651
3091258651
3091257549
3091167934
3091167934
3091071477
3090986697
3090986697
3091010242
3091010242
3090917283
3090917283
3090917283
3090863020
309...

result:

ok 100000 lines

Test #8:

score: 10
Accepted
time: 641ms
memory: 19384kb

input:

200000
2 20002
20003 3
4 20004
5 20005
6 20006
7 20007
8 20008
20009 9
10 20010
20011 11
12 20012
20013 13
20014 14
20015 15
16 20016
17 20017
20018 18
20019 19
20020 20
20021 21
20022 22
20023 23
24 20024
20025 25
20026 26
20027 27
28 20028
29 20029
20030 30
31 20031
32 20032
33 20033
20034 34
35 2...

output:

12391910784
12391882519
12391882519
12391756806
12391560321
12391560321
12391415851
12391415851
12391415851
12391230152
12391045693
12390849932
12390849932
12390849932
12390849932
12390645206
12390645206
12390457119
12390457119
12390457119
12390457119
12390282296
12390282296
12390083838
12390131597
...

result:

ok 180001 lines

Test #9:

score: 10
Accepted
time: 703ms
memory: 19360kb

input:

200000
2 20002
3 20003
20004 4
20005 5
20006 6
7 20007
20008 8
20009 9
20010 10
20011 11
20012 12
20013 13
20014 14
20015 15
20016 16
17 20017
18 20018
19 20019
20020 20
21 20021
22 20022
23 20023
24 20024
20025 25
20026 26
27 20027
20028 28
29 20029
20030 30
20031 31
20032 32
33 20033
20034 34
35 2...

output:

12390276806
12390276806
12390067487
12389873662
12389727088
12389611577
12389611577
12389611577
12389611577
12389611577
12389611577
12389477527
12389477527
12389314868
12389314868
12389294924
12389294924
12389294924
12389100978
12389005265
12389005265
12388817571
12388638967
12388638967
12388638967
...

result:

ok 199999 lines

Test #10:

score: 10
Accepted
time: 693ms
memory: 19420kb

input:

200000
20002 2
20003 3
20004 4
20005 5
6 20006
20007 7
20008 8
9 20009
10 20010
20011 11
20012 12
13 20013
14 20014
20015 15
16 20016
17 20017
20018 18
20019 19
20020 20
20021 21
20022 22
23 20023
24 20024
25 20025
26 20026
27 20027
20028 28
29 20029
30 20030
20031 31
32 20032
20033 33
34 20034
2003...

output:

12400149553
12400177008
12400192028
12400192028
12400231309
12400235505
12400235505
12400235505
12400038308
12399873171
12399709573
12399709573
12399709573
12399571370
12399571370
12399571370
12399571370
12399571370
12399571370
12399426558
12399245265
12399253079
12399247928
12399244532
12399080726
...

result:

ok 200000 lines