QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#104432#1974. Black Family TreeZhangYiDeTL 7ms16364kbC++171.7kb2023-05-10 18:21:212023-05-10 18:21:26

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 2ms
memory: 16364kb

input:

6 5
1 2 4 8 16 32
1 2 2 1 5
1 1
2 3
4 5
2 6
6 6

output:

63
14
56
62
32

result:

ok 5 lines

Test #2:

score: 0
Accepted
time: 7ms
memory: 13400kb

input:

5 25
4723 3513 2046 6286 9584
1 2 2 1
1 5
5 5
2 3
2 3
4 4
2 4
2 2
1 2
2 5
3 3
2 2
1 3
2 4
1 5
2 2
3 3
3 5
2 5
1 3
1 5
2 3
4 5
4 4
4 4
1 3

output:

26152
9584
11845
11845
6286
11845
11845
26152
21429
2046
11845
26152
11845
26152
11845
2046
17916
21429
26152
26152
11845
15870
6286
6286
26152

result:

ok 25 lines

Test #3:

score: 0
Accepted
time: 2ms
memory: 13064kb

input:

10 100
1457 936 8200 7604 1431 2726 6728 2545 3010 267
1 2 3 4 5 2 1 6 6
1 9
7 7
4 4
3 10
4 7
2 2
2 10
6 8
4 7
3 10
8 8
3 10
4 6
4 4
4 8
5 9
1 1
5 7
5 10
9 9
6 8
6 6
10 10
2 4
1 5
7 9
2 3
4 10
3 8
2 10
6 10
5 7
1 1
4 5
3 5
6 8
7 7
2 5
3 3
7 9
2 10
1 8
1 2
1 4
1 10
3 4
4 7
3 4
2 2
2 10
2 3
1 9
3 4
9 ...

output:

34904
6728
15038
32511
21766
30902
33447
15276
21766
32511
2545
32511
15038
15038
24311
16707
34904
14162
16707
3010
15276
6003
267
30902
34904
12283
30902
24311
32511
33447
15276
14162
34904
15038
23238
15276
6728
30902
23238
12283
33447
34904
34904
34904
34904
23238
21766
23238
30902
33447
30902
3...

result:

ok 100 lines

Test #4:

score: 0
Accepted
time: 3ms
memory: 13212kb

input:

20 400
3369 7577 2036 6800 9118 4011 4163 6177 7663 7722 8570 5139 5089 3187 9604 2154 9765 8074 4140 4101
1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 9 9 10 10
3 4
10 16
5 12
8 10
10 11
14 16
13 13
20 20
14 14
8 15
7 19
6 6
5 13
16 16
10 19
2 3
4 15
3 5
18 18
7 16
2 16
8 13
20 20
13 13
3 18
10 10
17 20
5 7
8 8
1...

output:

107513
49706
98677
59400
24533
14945
5089
4101
3187
81385
85548
17720
98677
2154
67545
115090
105477
107513
8074
85548
115090
78198
4101
5089
107513
15963
26080
80742
17935
15963
107513
41465
11758
28234
107513
29672
105477
9765
11919
11758
51582
85548
67545
30159
3187
63450
118459
9604
98677
8570
2...

result:

ok 400 lines

Test #5:

score: -100
Time Limit Exceeded

input:

100000 100000
8029 7085 635 4300 6254 5928 4621 9793 9449 1053 5741 4135 7188 9600 5024 3024 9332 4417 6458 3033 4875 637 3280 3787 5535 9296 3390 4590 8158 5782 4977 8335 4453 5676 3484 9232 6052 214 5229 6335 1743 6960 9857 668 7712 6593 5491 579 553 1045 134 2072 9101 8502 9225 1930 5188 2631 864...

output:

2875897
4245113
7279182
484062622
51021802
100278165
2716542
323855818
69291
64093
455140
22310982
489033
12666804
32960004
1108250
6235193
366507450
5544535
54254936
21740405
8370
3738236
17471
347386358
338123464
1735828
8391
1633409
224525
1262580
338900101
29624
73125
50789
125592361
423584668
2...

result: