QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#927677#9358. Big NumbersNatsuhi Kage (Qiyu Feng, Jianing Liu, Zemu Zhu) #AC ✓158ms52340kbC++232.0kb2025-03-07 14:31:122025-03-07 14:31:13

详细

Test #1:

score: 100
Accepted
time: 1ms
memory: 10872kb

input:

7
1 1
2 1
1 4
2 2
1 2
5 0

output:

52

result:

ok 1 number(s): "52"

Test #2:

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

input:

3
1 28
1 1000000000000000000

output:

752834992

result:

ok 1 number(s): "752834992"

Test #3:

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

input:

2
1 1

output:

4

result:

ok 1 number(s): "4"

Test #4:

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

input:

3
1 1
1 1

output:

6

result:

ok 1 number(s): "6"

Test #5:

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

input:

3
1 1
2 1

output:

12

result:

ok 1 number(s): "12"

Test #6:

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

input:

10
1 32
2 54
3 36
4 24
5 100
6 72
7 78
8 22
9 38

output:

41933096

result:

ok 1 number(s): "41933096"

Test #7:

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

input:

50
1 76839
1 10695
2 95028
1 88230
1 95786
2 55854
1 14285
4 56657
2 23776
9 57637
6 20121
2 85208
3 68360
1 82074
14 48280
2 21700
8 41152
7 65169
4 15832
8 98510
10 50694
21 43313
17 83797
17 92918
4 38194
1 58138
11 4526
8 59597
16 3072
23 45352
12 91956
18 69374
11 36426
16 22482
2 67200
7 77724...

output:

362557404

result:

ok 1 number(s): "362557404"

Test #8:

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

input:

200
1 633332252764166990
2 946352476938448439
3 914627382920775667
4 651835180208782818
5 672332336525769370
6 847934933775441205
7 237153116660217199
8 692545383136663191
9 170584314607552708
10 555350436719262418
11 651285925422389460
11 561861509979757094
13 714485377379662517
14 2382325439418150...

output:

131742934

result:

ok 1 number(s): "131742934"

Test #9:

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

input:

500
1 633332252764166990
1 946352476938448439
1 914627382920775667
1 651835180208782818
1 672332336525769370
1 847934933775441205
1 237153116660217199
1 692545383136663191
1 170584314607552708
1 555350436719262418
1 651285925422389460
1 561861509979757094
1 714485377379662517
1 238232543941815045
1 ...

output:

648486958

result:

ok 1 number(s): "648486958"

Test #10:

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

input:

1000
1 633332252764166990
2 946352476938448439
2 914627382920775667
4 651835180208782818
5 672332336525769370
4 847934933775441205
7 237153116660217199
8 692545383136663191
9 170584314607552708
7 555350436719262418
11 651285925422389460
12 561861509979757094
13 714485377379662517
14 2382325439418150...

output:

12424592

result:

ok 1 number(s): "12424592"

Test #11:

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

input:

2000
1 49
1 49
3 35
3 47
5 16
5 51
7 170
7 88
9 135
9 145
11 65
11 29
13 183
13 109
15 16
15 189
17 64
17 3
19 109
19 61
21 78
21 88
23 103
23 1
25 187
25 197
27 6
27 44
29 55
29 37
31 196
31 87
33 118
33 0
35 19
35 193
37 32
37 85
39 146
39 49
41 25
41 141
43 32
43 177
45 131
45 121
47 140
47 135
4...

output:

222737182

result:

ok 1 number(s): "222737182"

Test #12:

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

input:

5000
1 1000000000000000000
1 1000000000000000000
2 1000000000000000000
2 1000000000000000000
3 1000000000000000000
3 1000000000000000000
4 1000000000000000000
4 1000000000000000000
5 1000000000000000000
5 1000000000000000000
6 1000000000000000000
6 1000000000000000000
7 1000000000000000000
7 1000000...

output:

373732960

result:

ok 1 number(s): "373732960"

Test #13:

score: 0
Accepted
time: 8ms
memory: 10692kb

input:

10000
1 633332252764166990
2 946352476938448439
3 914627382920775667
4 651835180208782818
5 672332336525769370
6 847934933775441205
7 237153116660217199
8 692545383136663191
9 170584314607552708
10 555350436719262418
11 651285925422389460
12 561861509979757094
13 714485377379662517
14 23823254394181...

output:

868626594

result:

ok 1 number(s): "868626594"

Test #14:

score: 0
Accepted
time: 25ms
memory: 18224kb

input:

50000
1 76839
2 10695
3 95028
4 88230
5 95786
6 55854
7 14285
8 56657
9 23776
10 57637
11 20121
12 85208
13 68360
14 82074
15 48280
16 21700
17 41152
18 65169
19 15832
20 98510
21 50694
22 43313
23 83797
24 92918
25 38194
26 58138
27 4526
28 59597
29 3072
30 45352
31 91956
32 69374
33 36426
34 22482...

output:

231332884

result:

ok 1 number(s): "231332884"

Test #15:

score: 0
Accepted
time: 77ms
memory: 32612kb

input:

100000
1 633332252764166990
2 946352476938448439
3 914627382920775667
4 651835180208782818
5 672332336525769370
6 847934933775441205
7 237153116660217199
8 692545383136663191
9 170584314607552708
10 555350436719262418
11 651285925422389460
12 561861509979757094
13 714485377379662517
14 2382325439418...

output:

50402776

result:

ok 1 number(s): "50402776"

Test #16:

score: 0
Accepted
time: 76ms
memory: 22620kb

input:

100000
1 633332252764166990
1 946352476938448439
1 914627382920775667
1 651835180208782818
1 672332336525769370
1 847934933775441205
1 237153116660217199
1 692545383136663191
1 170584314607552708
1 555350436719262418
1 651285925422389460
1 561861509979757094
1 714485377379662517
1 238232543941815045...

output:

710257616

result:

ok 1 number(s): "710257616"

Test #17:

score: 0
Accepted
time: 19ms
memory: 16360kb

input:

100000
1 1000000000000000000
1 1000000000000000000
1 1000000000000000000
1 1000000000000000000
1 1000000000000000000
1 1000000000000000000
1 1000000000000000000
1 1000000000000000000
1 1000000000000000000
1 1000000000000000000
1 1000000000000000000
1 1000000000000000000
1 1000000000000000000
1 10000...

output:

572307514

result:

ok 1 number(s): "572307514"

Test #18:

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

input:

100000
1 633332252764166990
1 946352476938448439
2 914627382920775667
3 651835180208782818
5 672332336525769370
3 847934933775441205
4 237153116660217199
7 692545383136663191
6 170584314607552708
7 555350436719262418
11 651285925422389460
12 561861509979757094
4 714485377379662517
9 2382325439418150...

output:

273328861

result:

ok 1 number(s): "273328861"

Test #19:

score: 0
Accepted
time: 52ms
memory: 25940kb

input:

100000
1 76839
1 10695
3 95028
3 88230
5 95786
5 55854
7 14285
7 56657
9 23776
9 57637
11 20121
11 85208
13 68360
13 82074
15 48280
15 21700
17 41152
17 65169
19 15832
19 98510
21 50694
21 43313
23 83797
23 92918
25 38194
25 58138
27 4526
27 59597
29 3072
29 45352
31 91956
31 69374
33 36426
33 22482...

output:

297371770

result:

ok 1 number(s): "297371770"

Test #20:

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

input:

100000
1 5266761964
2 776999701
3 3564370206
4 7694832347
5 3994754048
6 2223341075
7 1500614898
8 3953802122
9 9401047313
10 331008525
11 9318846234
12 9063143758
13 1334525028
14 6829223835
15 418086270
16 2564399030
17 6725124458
18 4458037056
19 4465481964
20 6151260026
21 2816346602
22 98481679...

output:

731307079

result:

ok 1 number(s): "731307079"

Test #21:

score: 0
Accepted
time: 75ms
memory: 31456kb

input:

100000
1 633332252764166990
2 946352476938448439
3 914627382920775667
4 651835180208782818
5 672332336525769370
6 847934933775441205
7 237153116660217199
8 692545383136663191
9 170584314607552708
10 555350436719262418
11 651285925422389460
12 561861509979757094
13 714485377379662517
14 2382325439418...

output:

97980012

result:

ok 1 number(s): "97980012"

Test #22:

score: 0
Accepted
time: 158ms
memory: 52340kb

input:

100000
1 633332252764166990
1 946352476938448439
2 914627382920775667
2 651835180208782818
3 672332336525769370
3 847934933775441205
4 237153116660217199
4 692545383136663191
5 170584314607552708
5 555350436719262418
6 651285925422389460
6 561861509979757094
7 714485377379662517
7 238232543941815045...

output:

116879039

result:

ok 1 number(s): "116879039"

Test #23:

score: 0
Accepted
time: 74ms
memory: 33448kb

input:

100000
1 682
1 773
2 186
2 753
3 692
3 740
4 747
4 811
5 813
5 230
6 658
6 558
7 530
7 970
8 26
8 263
9 829
9 15
10 105
10 539
11 499
11 683
12 452
12 966
13 970
13 884
14 438
14 737
15 674
15 848
16 763
16 427
17 778
17 568
18 351
18 400
19 520
19 345
20 265
20 264
21 830
21 793
22 441
22 836
23 56...

output:

332472072

result:

ok 1 number(s): "332472072"

Test #24:

score: 0
Accepted
time: 34ms
memory: 30144kb

input:

100000
1 682
2 773
3 186
4 753
5 692
6 740
7 747
8 811
9 813
10 230
11 658
12 558
13 530
14 970
15 26
16 263
17 829
18 15
19 105
20 539
21 499
22 683
23 452
24 966
25 970
26 884
27 438
28 737
29 674
30 848
31 763
32 427
33 778
34 568
35 351
36 400
37 520
38 345
39 265
40 264
41 830
42 793
43 441
44 ...

output:

787119108

result:

ok 1 number(s): "787119108"

Test #25:

score: 0
Accepted
time: 80ms
memory: 24176kb

input:

99999
1 0
1 0
2 6594097362
2 9676690265
2 392142324786635818
2 2127979052
2 808333101093825416
2 3484298268
2 1244095237
2 452489044773411502
2 2765007917
2 7822356166
2 739138692787093915
2 548679925300414867
2 661556553099256255
2 3697469003
2 9421026690
2 134660427125507029
2 8093097326
2 8940032...

output:

182860764

result:

ok 1 number(s): "182860764"

Test #26:

score: 0
Accepted
time: 76ms
memory: 24272kb

input:

99999
1 0
1 0
2 227914043506557947
2 657828597
2 3732468015
2 231842781625471211
2 306655319310201651
2 154637287917389973
2 158790273313626953
2 1743150796
2 214167105143615423
2 1653653346
2 8619520427
2 903963188843868531
2 992827047682832623
2 132397004177675085
2 258961652050594547
2 8943833036...

output:

598176487

result:

ok 1 number(s): "598176487"

Test #27:

score: 0
Accepted
time: 76ms
memory: 24284kb

input:

99999
1 0
1 0
2 815644414574760021
2 883734425263529209
2 451472084324156983
2 1231373088
2 874155010772303683
2 319642802782073477
2 583737734891501657
2 328184901680244764
2 653278117610158248
2 166886226196175854
2 961085435465415742
2 125786610313656367
2 759120442313381165
2 189848368129276775
...

output:

746671958

result:

ok 1 number(s): "746671958"

Test #28:

score: 0
Accepted
time: 76ms
memory: 24756kb

input:

99999
1 0
1 0
2 572644405526060326
2 51100899
2 29893964141108907
2 758400766166930702
2 1596853884
2 776730868657624283
2 674353335149537206
2 227780093363090880
2 2208316927
2 3045469960
2 3881394589
2 963413411892846139
2 2956012019
2 3096342623
2 2758628548
2 2743315937
2 9294517697
2 3002421605...

output:

985633258

result:

ok 1 number(s): "985633258"

Test #29:

score: 0
Accepted
time: 73ms
memory: 25216kb

input:

99999
1 0
1 0
2 7574918699
2 989863618602291608
2 5078414002
2 9911009386
2 6865221226
2 303457051325150084
2 978195217297144065
2 737293130674550366
2 878697167145506629
2 613452473382794633
2 536413977924267582
2 469734607189932833
2 610082746406755037
2 493133043212142289
2 3222810459
2 668977244...

output:

370345928

result:

ok 1 number(s): "370345928"

Test #30:

score: 0
Accepted
time: 75ms
memory: 24468kb

input:

99999
1 0
1 0
2 4893892740
2 170096879071371845
2 842347967614130387
2 114313853085609166
2 3806186061
2 116117774456846303
2 582608938840433707
2 5216820230
2 342446814131086979
2 8583869865
2 2365010074
2 966740656805631675
2 679032379563809593
2 3655395728
2 5715883315
2 244294379
2 1862761871020...

output:

431795296

result:

ok 1 number(s): "431795296"

Test #31:

score: 0
Accepted
time: 74ms
memory: 25248kb

input:

99999
1 0
1 0
2 881740415819536738
2 1291506552
2 865535785716794204
2 424257419245914467
2 738022723072667347
2 871770104216659409
2 5156079
2 7205352428
2 99577084680235949
2 233304515216882947
2 7577807773
2 2283379607
2 693678250065330849
2 839448794048140030
2 4493181245
2 1576941740
2 64680939...

output:

391324726

result:

ok 1 number(s): "391324726"

Test #32:

score: 0
Accepted
time: 72ms
memory: 25144kb

input:

99999
1 0
1 0
2 214320072
2 494617801794156792
2 9992244825
2 79257877480488480
2 91370970425557279
2 438021633
2 9343459180
2 364360369885279856
2 9794331794
2 6080540711
2 8060051749
2 621364206
2 431184763
2 1285626532
2 40057800075805694
2 136671536
2 205989455
2 9789989852
2 8078642603
2 943490...

output:

701745673

result:

ok 1 number(s): "701745673"

Test #33:

score: 0
Accepted
time: 74ms
memory: 24288kb

input:

99999
1 0
1 0
2 700773978880981167
2 8055411550
2 5982359193
2 354535577747215523
2 6851231343
2 741712371183805131
2 3681043681
2 2714609762
2 321012604798079190
2 9130895285
2 41043255071113022
2 617653650563690052
2 7466736297
2 658826989419782486
2 945573457257866772
2 7118915147
2 8837655813248...

output:

934525041

result:

ok 1 number(s): "934525041"

Test #34:

score: 0
Accepted
time: 78ms
memory: 24376kb

input:

99999
1 0
1 0
2 89546686310239498
2 3153360924
2 5123628709
2 7514056213
2 470140175716910244
2 5444966402
2 7279096869
2 970879782647554924
2 3414603877
2 4854458125
2 3244093870
2 7221531073
2 902907925964766527
2 207664459
2 788720423226751429
2 8308145463
2 590347735465636135
2 14899445057390659...

output:

740040718

result:

ok 1 number(s): "740040718"

Extra Test:

score: 0
Extra Test Passed