QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#77515#5369. 时间旅行larryzhong26 4560ms3844kbC++174.2kb2023-02-15 00:52:532023-02-15 00:52:55

Details

Tip: Click on the bar to expand more detailed information

Subtask #1:

score: 3
Accepted

Test #1:

score: 3
Accepted
time: 2ms
memory: 3464kb

input:

13 1
1 13
1 2
1 9
1 11
1 8
1 5
1 6
1 4
1 10
1 7
1 12
1 1
1 3

output:

6

result:

ok single line: '6'

Test #2:

score: 0
Accepted
time: 102ms
memory: 3556kb

input:

101 1
1 71
1 95
1 1
1 4
1 85
1 11
1 94
1 29
1 99
1 41
1 59
1 51
1 79
1 67
1 13
1 84
1 16
1 43
1 55
1 18
1 92
1 10
1 77
1 86
1 49
1 20
1 8
1 32
1 72
1 40
1 52
1 76
1 39
1 61
1 82
1 66
1 44
1 3
1 35
1 37
1 48
1 15
1 96
1 33
1 83
1 2
1 30
1 75
1 54
1 70
1 22
1 63
1 60
1 88
1 97
1 34
1 9
1 17
1 57
1 80
...

output:

50

result:

ok single line: '50'

Test #3:

score: 0
Accepted
time: 2244ms
memory: 3708kb

input:

291 1
1 1
1 243
1 31
1 188
1 77
1 101
1 20
1 177
1 58
1 12
1 201
1 152
1 89
1 205
1 203
1 214
1 225
1 94
1 147
1 100
1 235
1 103
1 196
1 216
1 192
1 143
1 6
1 259
1 215
1 51
1 234
1 2
1 102
1 17
1 157
1 82
1 52
1 211
1 176
1 264
1 149
1 74
1 105
1 202
1 172
1 226
1 165
1 271
1 78
1 285
1 262
1 88
1 ...

output:

145

result:

ok single line: '145'

Subtask #2:

score: 8
Accepted

Test #4:

score: 8
Accepted
time: 4ms
memory: 3400kb

input:

14 2
2 844974872 196961856
2 282529753 793092789
1 450615292
2 894675938 183278191
2 134804124 988858141
1 440476238
2 892091463 453193625
2 918614039 267044448
1 91126449
2 699070127 177282394
2 365458732 596469725
2 789994620 379428523
2 758349986 369167103
2 227448762 297426831

output:

392388416

result:

ok single line: '392388416'

Test #5:

score: 0
Accepted
time: 0ms
memory: 3384kb

input:

15 3
2 638683108 412097665
2 83585363 50407490
2 843046135 358173578
1 663325200
2 608604244 118346780
2 802365081 329993762
2 507345539 849824533
2 130234046 104894823
2 203433503 491790497
2 257479357 356611715
2 393337689 968844221
2 637493087 938737497
2 165665517 338554501
2 32482910 142430578
...

output:

461498682

result:

ok single line: '461498682'

Test #6:

score: 0
Accepted
time: 4ms
memory: 3420kb

input:

15 7
2 4067 4163
2 3780 4073
2 4060 4132
2 4115 4095
2 3801 4137
2 3767 4097
1 3976
1 4074
2 4141 4153
2 3965 4092
2 4080 3902
2 3863 4136
2 4153 4057
2 4045 3789
2 4117 4093

output:

198

result:

ok single line: '198'

Test #7:

score: 0
Accepted
time: 5ms
memory: 3392kb

input:

15 1
1 873331282220671423
2 735219904810912770 161751845932907141
2 25004270082210777 318839217154000771
2 674996277812508140 449008857311902192
2 472769470430097478 397080345283004274
2 47924412360460752 498222902664554012
2 564253525446680521 853694259885512872
2 656010667051096953 815344423905298...

output:

458440019518723706

result:

ok single line: '458440019518723706'

Test #8:

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

input:

15 13
2 896348312198404671 869762298
2 131322200859472553 156263978028639571
2 519956577 38
1 160595875
2 945987587 50986789140245249
2 41 241229344708873674
2 608655655392127091 41
1 40
2 806584170 50835315064131334
2 3623574246181054 976074155891825784
2 58183525 937860538
2 998266378 826367056
2 ...

output:

430005287589733910

result:

ok single line: '430005287589733910'

Subtask #3:

score: 0
Time Limit Exceeded

Dependency #1:

100%
Accepted

Test #9:

score: 5
Accepted
time: 3594ms
memory: 3764kb

input:

287 1
1 173840701363378004
1 743361258032855446
1 746614854489854642
1 56541606566914354
1 420238720727662982
1 851742472173310082
1 663095483358412253
1 909940213272622771
1 793226013158281220
1 545752184531876147
1 428168322861170312
1 445062401949703086
1 781910693870313013
1 656624250154096657
1...

output:

449906768878285431

result:

ok single line: '449906768878285431'

Test #10:

score: 0
Accepted
time: 3183ms
memory: 3844kb

input:

291 1
1 200467876183364735
1 226128802768594222
1 30992945592387546
1 131773707522781490
1 237517614711585543
1 767178437925265104
1 476367111669121061
1 569219147773036356
1 307153686500641679
1 256093763487190540
1 489553827811869668
1 665158752209826021
1 821778345278263808
1 591434397265270731
1...

output:

413750515661326196

result:

ok single line: '413750515661326196'

Test #11:

score: 0
Accepted
time: 4490ms
memory: 3760kb

input:

299 1
1 196564096074155356
1 215761209458809063
1 229199188828066663
1 207442460325459123
1 147931408833032623
1 165208810879220961
1 156890061745871023
1 281031394966631680
1 190804962058759240
1 165848714658709418
1 274632357171747109
1 178006886468990102
1 183126116704897759
1 263753992920443339
...

output:

95345663143780088

result:

ok single line: '95345663143780088'

Test #12:

score: 0
Accepted
time: 4560ms
memory: 3800kb

input:

291 1
1 33421439583378802
1 58525406002796904
1 59037731848091151
1 71845877980447328
1 54939125085737173
1 56305327339855169
1 59720832975150147
1 42814080080439994
1 38886248599850767
1 34446091273967295
1 80213866786920026
1 80384642068684774
1 58866956566326401
1 74919833052212806
1 674057206545...

output:

24762415855888600

result:

ok single line: '24762415855888600'

Test #13:

score: -5
Time Limit Exceeded

input:

299 1
1 65691845888395612
1 216175196973785149
1 60434785588469342
1 137319292474891070
1 61749050663450912
1 160976063824559296
1 86720087088100703
1 218803727123748287
1 169518786811939488
1 153747605912160670
1 165575991586994780
1 141919220237326556
1 35463749163819549
1 188575630399172220
1 145...

output:


result:


Subtask #4:

score: 0
Skipped

Dependency #3:

0%

Subtask #5:

score: 15
Accepted

Dependency #2:

100%
Accepted

Test #22:

score: 15
Accepted
time: 515ms
memory: 3480kb

input:

97 3
2 355271459380040532 547563913925852132
2 501938321780836726 747940481178452472
2 397422061492707294 74967044201975790
2 377923940791121468 378164526846394284
2 264704309452054653 529171612856996754
2 316250711337645385 284323194941392101
2 358629778571158126 368864454575116270
2 38360271038026...

output:

372997432997019308

result:

ok single line: '372997432997019308'

Test #23:

score: 0
Accepted
time: 462ms
memory: 3432kb

input:

95 3
2 594630321920106655 540002493103501660
2 125138319916363529 212072562657897457
2 373817802718383543 13665937791620288
2 315045821144016344 338252361890399510
2 483343425646600556 466582885679461518
2 278197329086017453 428516032353992829
1 59661599996472250
1 254583199582888328
2 4365367002001...

output:

340047122337218325

result:

ok single line: '340047122337218325'

Test #24:

score: 0
Accepted
time: 332ms
memory: 3480kb

input:

97 7
1 24243537937597964
2 582465432759982368 381373957332513395
2 391506769288663264 391876487817869396
2 299551892852869811 107731633859975720
2 156125257586893617 386175789126201813
2 213724291907872015 7697465108273724
2 393633870223728807 256416638715125266
2 290510273528299134 2903854981034601...

output:

333882379519018440

result:

ok single line: '333882379519018440'

Test #25:

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

input:

95 23
1 344791905917209572
2 500083441805144564 509549936981982064
2 329347121414961283 362188436612461360
2 104614943880747675 52960311801613673
2 617606793494520742 33376598049670497
2 342392895594188447 343263248105091839
2 322740972473445196 399001118836944088
2 263495523699786974 33004821266770...

output:

342055752596049500

result:

ok single line: '342055752596049500'

Test #26:

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

input:

99 55
2 89904938987641376 194722167738160343
2 365265714020104046 364275631130776282
2 357172107220911532 357175936070256675
2 366602422140587285 355364788434700731
2 361062739069662108 366182699259043884
2 337340987023855575 362758639984591817
2 356267270889109816 368009872611506605
2 3024813222427...

output:

364338868647435728

result:

ok single line: '364338868647435728'

Test #27:

score: 0
Accepted
time: 479ms
memory: 3448kb

input:

97 1
2 91117126161960832 152612010977891961
2 92648119158704985 151081017996819264
2 89586133179453808 154143003954271449
2 158480817402063313 85248319729017232
2 98516925587766625 145212211563875680
2 143681218561699334 100047918559918464
2 91372291675484725 152356845482241792
2 42496577125387271 1...

output:

48991775437581466

result:

ok single line: '48991775437581466'

Test #28:

score: 0
Accepted
time: 791ms
memory: 3560kb

input:

99 7
2 98167144235383792 162846238547509242
2 110279334179192048 150734048597100487
2 100105094626393120 160908288150903547
1 103496507811808992
2 113670747363458352 147342635414727615
2 155578924576512119 105434458201668736
2 114881966366627512 146131416432864448
2 143224490830472185 11778889194435...

output:

49417734962138572

result:

ok single line: '49417734962138572'

Test #29:

score: 0
Accepted
time: 649ms
memory: 3512kb

input:

97 9
2 54431100011379795 123163200193479616
2 76135973755564686 101458326453569856
2 114963581215047218 62630718965509088
2 113998920169962160 63595380028205758
2 66489363185937488 111104937001685664
2 112551928586934876 65042371606848045
2 119786886500604768 57807413693802295
2 117134068599060240 6...

output:

48715383286150883

result:

ok single line: '48715383286150883'

Test #30:

score: 0
Accepted
time: 450ms
memory: 3508kb

input:

99 25
2 106010712580746813 121015703886102576
2 100887057019501060 126139359431213171
2 120771720272231650 106254696174568800
2 123333548053805727 103692868393393504
2 99789130823331506 127237285640385408
2 100277098028296147 126749318429244132
2 47759708926726656 131506998592303065
2 12418749064706...

output:

27082179393946704

result:

ok single line: '27082179393946704'

Test #31:

score: 0
Accepted
time: 239ms
memory: 3504kb

input:

97 45
2 60136866605811552 124345544107147019
2 76594686469603390 107887724253254560
2 69408877811642167 115073532918614193
2 112291929565404383 72190481171528075
2 75203884789228032 109278525930449428
2 113914531507888702 70567879194386446
2 77753687885725021 106728722854530224
2 62918469962749976 1...

output:

55168466576040844

result:

ok single line: '55168466576040844'

Test #32:

score: 0
Accepted
time: 629ms
memory: 3552kb

input:

99 5
2 198135106606661855 113916402567297699
2 48120191860754846 293410793355960751
2 94941794543868424 20417673785789215
1 226217845720159620
2 73684573953683624 17570909162001220
2 101022587365517836 196966396107737257
2 92243699696770229 40192370826192154
2 231607253778443314 80159020488470828
2 ...

output:

168539672203603029

result:

ok single line: '168539672203603029'

Test #33:

score: 0
Accepted
time: 323ms
memory: 3548kb

input:

95 3
2 50213096412115275 103975930702601995
2 97337964450805816 52911609072878411
2 117019404580474190 114025828858917779
2 68255057774800636 33171864123352472
2 170782259210777541 8977948292011175
2 117937890322882815 124616648634050928
2 155488867905104901 231131932024847380
2 33763780676475410 13...

output:

167986301522260786

result:

ok single line: '167986301522260786'

Test #34:

score: 0
Accepted
time: 368ms
memory: 3444kb

input:

97 9
2 183888672937660637 30553903041146403
2 26197600647874261 87569599505429025
2 79122891657061301 43560019083754841
2 174537878354732366 25842168242849089
2 256946649950496002 45156982881291173
2 177513401227386667 60176368310826634
2 259839002603971882 83808389793977724
2 127533091953826330 190...

output:

188080092526197682

result:

ok single line: '188080092526197682'

Test #35:

score: 0
Accepted
time: 321ms
memory: 3508kb

input:

97 11
2 179169235362173901 197851068898330160
2 110092684659314938 38263031223051509
2 271561202603146920 193668015553789322
2 137293773808224547 96546099567205926
2 106034584983483180 120406372225155512
1 209157017448366887
2 198420117636462395 56078492848670786
2 32278873506739235 8910442247556405...

output:

176745142904935557

result:

ok single line: '176745142904935557'

Test #36:

score: 0
Accepted
time: 535ms
memory: 3468kb

input:

97 83
2 3058210112348103 251656328569775857
2 159979467084234473 14653211943110880
2 76647717823732513 16261613594275528
2 38738564467155027 180450713596174741
2 49378591649363047 81990160674878691
2 70059707062311627 43810417369623980
2 146798765491272833 66669774091202626
2 59887191859459332 21054...

output:

164989133334695959

result:

ok single line: '164989133334695959'

Test #37:

score: 0
Accepted
time: 445ms
memory: 3504kb

input:

95 3
1 79746836969422427
1 42391428648545948
1 88875953530675857
2 88841916692095381 137627653936820508
2 712052024007309148 333423189903908250
2 986954048764504050 128101575472945186
2 230622076265569785 572057638300385894
2 528803236876069800 659146479704153761
2 7538214892502187 1171687065730782
...

output:

493465914306706541

result:

ok single line: '493465914306706541'

Test #38:

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

input:

99 7
2 655813374949405866 823577592729353044
1 640042878929844449
2 695642933493784371 945344536691197960
2 541964275561186574 7430765146141955
2 39312995416278820 627166137018189317
2 629262138849170590 286213175761499517
2 348709480000878755 401714233242657861
2 654694573696082390 3124050086905211...

output:

499287770269278734

result:

ok single line: '499287770269278734'

Test #39:

score: 0
Accepted
time: 561ms
memory: 3636kb

input:

97 9
2 475518932525346244 343403718312668543
2 879231240161276859 10450928184363035
1 105804198533526150
2 610676660756860171 204196709613629013
2 422878093774396458 61610978468941477
2 482420390241772890 733073164585000299
2 244803056545563584 8188923919910582
2 900521888056791479 45475387423808153...

output:

492740313054335165

result:

ok single line: '492740313054335165'

Test #40:

score: 0
Accepted
time: 594ms
memory: 3560kb

input:

99 21
2 647804602481517176 415705130952528606
2 337297773077441698 459345775513725917
1 651747956168927564
1 346840608178513093
2 43032416133085083 971214472621300347
2 509801562927695174 60076272302632014
2 938067487641306760 579154632324366305
2 137031321641654131 353732664563203692
2 121904481290...

output:

490601692536600317

result:

ok single line: '490601692536600317'

Test #41:

score: 0
Accepted
time: 557ms
memory: 3504kb

input:

99 35
2 91182147626737794 95766028528018665
2 15832534471368700 78849240629511181
2 72744761231271027 588978061306441444
2 249424250283220487 518174250150106785
2 696855615852331379 665858146558163461
2 72245644754216308 856062009968434543
2 26104920612852352 621858855883079202
2 32258629809556553 9...

output:

495063067687704945

result:

ok single line: '495063067687704945'

Subtask #6:

score: 0
Time Limit Exceeded

Dependency #5:

100%
Accepted

Test #42:

score: 0
Time Limit Exceeded

input:

197 3
4 254449407090124613 112140590900425972 309238953726281947 391489935037483281
3 81718890371981946 311720329125105766 510862207453246006
4 432686156999435021 349733674175878549 398194808015575569 566023817519883042
4 181267378904922445 380086723415223853 539271538418079357 59944569356014918
4 6...

output:


result:


Subtask #7:

score: 0
Skipped

Dependency #1:

100%
Accepted

Dependency #2:

100%
Accepted

Dependency #3:

0%