QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#777753#3849. Cactus cuttingUW2 (Jakub Dziura, Piotr Blinowski, Dominik Wawszczak) AC ✓788ms62304kbC++235.9kb2024-11-24 07:50:162024-11-24 07:50:17

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 186ms
memory: 22900kb

input:

75000 99998
1 2
1 3
1 6
1 13
1 14
1 17
1 19
1 54
1 62
1 64
1 25003
1 50002
1 25004
1 50003
1 25005
1 50004
1 25006
1 50005
1 25007
1 50006
1 25008
1 50007
1 25009
1 50008
1 25010
1 50009
1 25011
1 50010
1 25012
1 50011
1 25013
1 50012
1 25014
1 50013
1 25015
1 50014
1 25016
1 50015
1 25017
1 50016
1...

output:

224026

result:

ok single line: '224026'

Test #2:

score: 0
Accepted
time: 187ms
memory: 22888kb

input:

75000 99998
1 2
1 3
1 10
1 18
1 63
1 514
1 3552
1 4093
1 6245
1 22678
1 25003
1 50002
1 25004
1 50003
1 25005
1 50004
1 25006
1 50005
1 25007
1 50006
1 25008
1 50007
1 25009
1 50008
1 25010
1 50009
1 25011
1 50010
1 25012
1 50011
1 25013
1 50012
1 25014
1 50013
1 25015
1 50014
1 25016
1 50015
1 2501...

output:

429308

result:

ok single line: '429308'

Test #3:

score: 0
Accepted
time: 188ms
memory: 22992kb

input:

75000 99998
1 2
1 3
1 58
1 66
1 77
1 210
1 770
1 844
1 25003
1 50002
1 25004
1 50003
1 25005
1 50004
1 25006
1 50005
1 25007
1 50006
1 25008
1 50007
1 25009
1 50008
1 25010
1 50009
1 25011
1 50010
1 25012
1 50011
1 25013
1 50012
1 25014
1 50013
1 25015
1 50014
1 25016
1 50015
1 25017
1 50016
1 25018...

output:

355105

result:

ok single line: '355105'

Test #4:

score: 0
Accepted
time: 187ms
memory: 23080kb

input:

75000 99998
1 2
1 6
1 89
1 137
1 169
1 2929
1 6649
1 24127
1 25003
1 50002
1 25004
1 50003
1 25005
1 50004
1 25006
1 50005
1 25007
1 50006
1 25008
1 50007
1 25009
1 50008
1 25010
1 50009
1 25011
1 50010
1 25012
1 50011
1 25013
1 50012
1 25014
1 50013
1 25015
1 50014
1 25016
1 50015
1 25017
1 50016
1...

output:

729262

result:

ok single line: '729262'

Test #5:

score: 0
Accepted
time: 179ms
memory: 22016kb

input:

75000 91998
1 2
1 7
1 8
1 11
1 77
1 107
1 118
1 332
1 804
1 14455
1 22866
1 34680
1 41003
1 58002
1 41004
1 58003
1 41005
1 58004
1 41006
1 58005
1 41007
1 58006
1 41008
1 58007
1 41009
1 58008
1 41010
1 58009
1 41011
1 58010
1 41012
1 58011
1 41013
1 58012
1 41014
1 58013
1 41015
1 58014
1 41016
1 ...

output:

916981

result:

ok single line: '916981'

Test #6:

score: 0
Accepted
time: 173ms
memory: 21536kb

input:

75000 91998
1 2
1 3
1 4
1 8
1 27
1 3972
1 4196
1 6344
1 8151
1 17056
1 41003
1 58002
1 41004
1 58003
1 41005
1 58004
1 41006
1 58005
1 41007
1 58006
1 41008
1 58007
1 41009
1 58008
1 41010
1 58009
1 41011
1 58010
1 41012
1 58011
1 41013
1 58012
1 41014
1 58013
1 41015
1 58014
1 41016
1 58015
1 41017...

output:

537508

result:

ok single line: '537508'

Test #7:

score: 0
Accepted
time: 180ms
memory: 21812kb

input:

75000 91998
1 2
1 4
1 7
1 16
1 60
1 72
1 77
1 87
1 448
1 3609
1 4997
1 10698
1 21177
1 41003
1 58002
1 41004
1 58003
1 41005
1 58004
1 41006
1 58005
1 41007
1 58006
1 41008
1 58007
1 41009
1 58008
1 41010
1 58009
1 41011
1 58010
1 41012
1 58011
1 41013
1 58012
1 41014
1 58013
1 41015
1 58014
1 41016...

output:

549167

result:

ok single line: '549167'

Test #8:

score: 0
Accepted
time: 184ms
memory: 21908kb

input:

75000 91998
1 2
1 3
1 19
1 55
1 133
1 229
1 263
1 277
1 352
1 729
1 41003
1 58002
1 41004
1 58003
1 41005
1 58004
1 41006
1 58005
1 41007
1 58006
1 41008
1 58007
1 41009
1 58008
1 41010
1 58009
1 41011
1 58010
1 41012
1 58011
1 41013
1 58012
1 41014
1 58013
1 41015
1 58014
1 41016
1 58015
1 41017
1 ...

output:

411498

result:

ok single line: '411498'

Test #9:

score: 0
Accepted
time: 44ms
memory: 10728kb

input:

75000 84355
1 60160
1 36004
1 2727
2 37452
3 48319
3 2480
4 58521
4 17803
4 43753
5 72576
5 29500
6 66502
6 8864
6 70643
7 52161
7 57465
8 41017
9 16472
9 32077
10 216
10 67333
10 6377
11 32592
11 15405
12 32930
12 72311
13 22378
13 19539
14 73204
14 47834
14 6326
15 65328
15 29270
16 62556
17 29754...

output:

0

result:

ok single line: '0'

Test #10:

score: 0
Accepted
time: 51ms
memory: 10772kb

input:

75000 84443
1 16256
1 65404
1 53817
2 15011
3 46150
3 58264
3 64631
4 63600
4 42517
5 35410
5 2918
6 43679
6 31347
7 313
7 26818
8 19803
8 28022
9 33081
9 58179
9 49534
10 28057
10 38811
10 65628
10 7342
11 8803
11 13929
12 41494
12 35263
13 32331
13 20071
13 45194
14 22131
14 51956
15 55884
15 2706...

output:

0

result:

ok single line: '0'

Test #11:

score: 0
Accepted
time: 53ms
memory: 10732kb

input:

75000 84361
1 14054
1 45822
1 5525
2 48240
2 55109
3 49958
3 43979
3 57569
3 13554
3 68084
4 38798
5 32827
5 3992
6 74366
6 62015
6 71485
7 8019
8 50760
8 19013
9 52224
10 38701
10 8292
11 10571
11 69807
11 68176
11 45014
11 38122
12 11627
12 63666
12 63447
13 72983
14 697
14 18585
14 11520
15 67317...

output:

0

result:

ok single line: '0'

Test #12:

score: 0
Accepted
time: 57ms
memory: 10896kb

input:

75000 84446
1 12163
1 10711
2 49923
2 44701
2 8609
3 53520
3 43344
3 38631
4 51228
4 73023
4 29607
4 47035
5 59192
5 7614
5 6391
6 32925
6 7726
7 25514
7 9391
8 44630
9 68916
9 7576
9 67445
10 28334
10 27979
11 64824
12 40803
13 47302
13 21264
14 49825
14 54823
14 61784
15 2695
15 22559
16 50048
16 ...

output:

708959

result:

ok single line: '708959'

Test #13:

score: 0
Accepted
time: 62ms
memory: 11172kb

input:

80000 89652
1 66308
1 10222
2 26590
2 71306
3 66796
3 29384
4 70837
5 40447
5 47609
6 34764
7 11408
7 14944
8 314
8 74773
8 41874
8 71852
9 17383
9 67743
9 5347
10 19430
10 56609
11 417
12 76333
12 60115
13 18696
14 57507
14 74267
15 65479
15 38262
15 43748
15 33902
16 68798
16 14903
17 25416
17 514...

output:

554931

result:

ok single line: '554931'

Test #14:

score: 0
Accepted
time: 56ms
memory: 11260kb

input:

80000 89479
1 20098
1 29446
2 53025
3 77498
3 42267
3 48225
4 59800
5 49989
5 75588
6 46532
6 3921
6 65370
6 43573
7 24293
7 72322
7 41443
7 50945
8 79801
8 6185
8 14588
9 63479
9 43283
10 4729
10 72803
10 75177
11 74978
11 28556
11 8400
11 35850
12 2045
13 57480
13 25090
13 17356
14 75090
15 48767
...

output:

0

result:

ok single line: '0'

Test #15:

score: 0
Accepted
time: 63ms
memory: 10848kb

input:

80000 89541
1 37420
1 21167
2 27013
3 16643
3 7351
3 75810
4 72423
5 33283
5 24152
6 67473
6 35419
7 51075
8 64510
8 56113
9 25479
9 49232
10 79970
10 5793
11 72852
11 18034
11 53317
11 71175
12 74230
12 23826
13 30588
13 4880
13 13481
13 59718
13 48623
14 37346
15 1053
16 50470
17 78276
17 55335
17...

output:

0

result:

ok single line: '0'

Test #16:

score: 0
Accepted
time: 54ms
memory: 10876kb

input:

80000 89486
1 27427
1 14790
2 41804
2 6603
2 10074
2 26642
2 44375
3 11606
4 10048
4 48838
5 23219
6 53875
7 32447
7 10347
8 12387
8 19203
9 18548
9 64409
10 79601
11 48861
11 34818
12 50037
12 8561
12 46194
13 3983
14 5421
15 24834
15 43143
16 75566
17 26566
17 64114
17 70281
18 18296
18 43833
19 3...

output:

490881

result:

ok single line: '490881'

Test #17:

score: 0
Accepted
time: 70ms
memory: 11780kb

input:

90000 97174
1 7614
1 43646
2 71272
2 67043
3 53652
3 75364
4 77652
4 33533
5 2762
5 69727
6 33066
6 74704
6 32981
7 7827
8 32603
9 46684
9 23465
10 730
10 6472
10 8374
10 47655
11 49036
12 51500
12 2614
13 4012
13 15522
13 43567
14 52946
15 34403
15 83392
15 52725
16 44333
16 22639
16 748
17 18394
1...

output:

588018

result:

ok single line: '588018'

Test #18:

score: 0
Accepted
time: 69ms
memory: 11732kb

input:

90000 97212
1 33588
1 43881
2 32458
2 48845
3 10607
3 14583
3 61327
4 81356
5 85065
5 18512
5 9169
6 89640
6 70595
7 53905
7 32741
8 40142
9 35301
10 62004
11 30952
11 33180
12 61023
13 88711
13 36424
13 52374
14 23059
15 9374
16 68813
16 49264
16 8226
17 24553
17 69481
17 86966
18 1358
18 80756
18 ...

output:

729514

result:

ok single line: '729514'

Test #19:

score: 0
Accepted
time: 67ms
memory: 11572kb

input:

90000 97119
1 27709
1 75782
2 49423
2 43710
2 38280
3 79902
3 16177
4 17534
4 4971
4 52981
4 85259
5 61410
6 47670
6 24515
7 32817
7 7674
8 19146
9 2135
9 33461
9 77724
9 79066
9 66561
10 49909
11 65637
12 17342
12 24782
13 61518
13 47315
13 9454
13 6223
14 53351
14 21336
14 62013
15 34765
15 75067
...

output:

0

result:

ok single line: '0'

Test #20:

score: 0
Accepted
time: 66ms
memory: 11524kb

input:

90000 97163
1 31427
1 70685
2 36010
2 48358
3 59856
3 18107
3 51742
4 14392
5 83470
5 51954
6 26664
6 62806
6 48105
6 61407
7 12462
8 5611
9 70485
10 17935
11 18902
11 22543
12 1168
12 43259
12 34919
12 70473
13 11396
13 8129
14 24370
14 81633
15 62316
16 31708
16 5261
16 73888
17 35435
17 47626
18 ...

output:

0

result:

ok single line: '0'

Test #21:

score: 0
Accepted
time: 785ms
memory: 61648kb

input:

99999 99998
97945 69840
97945 99591
97945 23621
97945 96306
97945 49596
97945 45916
97945 90799
97945 95403
97945 93990
97945 98394
97945 41714
97945 61236
97945 1701
97945 37124
97945 16020
97945 19127
97945 59494
97945 64104
97945 63062
97945 37016
97945 97047
97945 50811
97945 35552
97945 23083
9...

output:

539460

result:

ok single line: '539460'

Test #22:

score: 0
Accepted
time: 788ms
memory: 62304kb

input:

99995 99996
1 99991
2 99991
3 99991
4 99991
5 99991
6 99991
7 99991
8 99991
9 99991
10 99991
11 99991
12 99991
13 99991
14 99991
15 99991
16 99991
17 99991
18 99991
19 99991
20 99991
21 99991
22 99991
23 99991
24 99991
25 99991
26 99991
27 99991
28 99991
29 99991
30 99991
31 99991
32 99991
33 99991
...

output:

627786

result:

ok single line: '627786'

Test #23:

score: 0
Accepted
time: 184ms
memory: 23072kb

input:

75001 100000
1 3
1 2
3 2
3 4
1 6
1 5
6 5
6 7
1 9
1 8
9 8
9 10
1 12
1 11
12 11
12 13
1 15
1 14
15 14
15 16
1 18
1 17
18 17
18 19
1 21
1 20
21 20
21 22
1 24
1 23
24 23
24 25
1 27
1 26
27 26
27 28
1 30
1 29
30 29
30 31
1 33
1 32
33 32
33 34
1 36
1 35
36 35
36 37
1 39
1 38
39 38
39 40
1 42
1 41
42 41
42...

output:

132779

result:

ok single line: '132779'