QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#870222#8616. Fast Tree Queriesucup-team3648#TL 132ms4736kbC++203.7kb2025-01-25 15:23:232025-01-25 15:23:26

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 0ms
memory: 3712kb

input:

5 6
1 2
1 3
3 4
3 5
? 2 5
+ 1 4 1
? 2 5
+ 4 5 2
? 4 5
? 1 1

output:

5
1
6
2

result:

ok 4 number(s): "5 1 6 2"

Test #2:

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

input:

100 100
6 74
6 93
7 46
7 78
10 77
11 9
11 19
11 37
11 51
11 65
12 57
13 15
13 81
13 100
14 2
14 31
16 11
16 24
16 43
16 82
18 4
18 8
21 56
24 29
24 96
26 22
27 32
28 59
29 6
29 94
32 33
35 54
35 80
35 88
37 66
37 71
37 84
38 17
39 64
39 92
40 49
43 7
43 13
43 44
43 79
44 35
44 60
44 63
44 73
46 75
4...

output:

106
66
23766
20394
16388
3365
12076
7844
43127
56700
59
34700
24083
1164
24068
18776
3375
17495
21576
63126
11157
108177
63127
99162
105173
10715
110921
18320
19725
30958
120179
81226
107525
15669
21804
31071
63099
8313
191380
232240
84531
89146
173181
5447
160027
228651
98075
32595
109808
221822
11...

result:

ok 51 numbers

Test #3:

score: 0
Accepted
time: 132ms
memory: 4736kb

input:

10000 10000
1 8776
3 1597
3 8333
4 675
4 6993
4 7587
5 3379
5 6733
7 2440
7 6480
7 9506
10 4545
10 6664
12 1476
12 5343
14 1340
14 4167
14 5990
14 9910
15 5118
15 9423
16 8106
17 3856
20 5201
23 1138
24 3431
24 5578
25 251
26 3219
26 4156
26 6668
27 3795
28 6282
28 8196
34 9595
35 3919
36 5893
37 58...

output:

9911
12310
4793
31764
2730
42301
62944
16978
8306
25311
3011
1327
48224
8407
15662
38117
42837
59074
40600
39018
126441
21755
24519
51286
121187
4335
8349
10553
60726
86675
10797
3883
90069
95477
129342
37777
42339
124045
94323
16858
217612
79454
258856
118337
257945
196316
170121
216631
168616
1663...

result:

ok 5012 numbers

Test #4:

score: -100
Time Limit Exceeded

input:

50000 50000
1 1362
3 3371
3 13803
3 41794
3 47253
5 6227
5 42748
5 47841
6 28509
6 47395
7 8651
8 35909
10 24241
10 31205
10 33574
10 44109
10 48982
12 31361
12 44645
13 42041
15 20480
16 9467
16 11685
16 16024
16 28894
16 30759
19 3485
19 23470
19 24714
22 14239
25 44841
31 20447
35 5378
35 45983
3...

output:

5042
36803
61033
62216
64370
9744
33748
43519
25564
87892
120265
52351
36778
1507
81138
124599
19620
169852
82219
106112
38410
47506
214605
229380
175036
184353
71808
135637
195043
213707
60790
86453
31176
26740
107180
117349
64903
55397
245841
33362
73881
227391
227333
52027
217335
146795
51029
100...

result: