QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#880809#10021. Interesting PermutationsKevin090228TL 2515ms28812kbC++234.2kb2025-02-03 20:53:442025-02-03 20:53:45

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 15ms
memory: 28772kb

input:

2 4
4 1 3
3 1 1
9 3 7
1 1 1

output:

16
2
27160
1

result:

ok 4 number(s): "16 2 27160 1"

Test #2:

score: 0
Accepted
time: 17ms
memory: 28808kb

input:

256 2
3 1 2
65536 1024 32768

output:

4
517264494

result:

ok 2 number(s): "4 517264494"

Test #3:

score: 0
Accepted
time: 2505ms
memory: 28680kb

input:

1 200000
99995 1 99995
86918 58999 70159
38506 19694 35974
61868 23700 48472
96263 21196 92667
36991 3780 9438
77068 4731 6756
91757 16570 17799
94328 32908 45275
96221 14327 73644
31545 3936 13527
75467 39216 53147
6504 3883 4018
44965 11765 21601
45895 906 15282
8325 977 5431
48153 35761 40406
974...

output:

819483871
13936401
546075692
56537597
518171841
682765317
946113420
111175382
527234083
884763597
215402563
461077254
49673662
300376005
120226240
844876192
638718737
11806698
960129878
223144195
848075741
521696018
957550193
62225566
854778724
728165545
839086009
308408176
495281237
923053738
66607...

result:

ok 200000 numbers

Test #4:

score: 0
Accepted
time: 2506ms
memory: 28676kb

input:

2 200000
99998 1 99998
14942 12835 14504
78337 14540 77264
40774 2149 5224
72834 23319 45958
23436 7205 13210
22999 5704 21120
50075 7797 48312
65548 20263 54003
38680 35258 35385
958 125 847
86462 57304 59001
13524 7735 10332
24825 4026 10613
77597 42777 60649
46561 41783 43903
57260 14800 45333
79...

output:

593638678
894905611
808484409
109484973
494854190
581276152
218322644
765497988
731898637
571661575
612587162
305378873
925139743
410143855
396930849
771876259
405448963
18985906
778342456
423902336
504843547
448841219
370446285
806431564
653687000
635238016
949045302
646728146
47297767
541560409
71...

result:

ok 200000 numbers

Test #5:

score: 0
Accepted
time: 2503ms
memory: 28680kb

input:

3 200000
99998 1 99998
79089 38062 70225
16287 6313 11810
11626 4897 6162
30908 6805 7969
51968 7604 47840
95655 93430 93696
40159 19951 27848
66589 42415 61700
67337 1817 24633
93671 6405 31948
55798 17805 29237
87579 31282 56392
68465 26379 42636
45046 31137 36834
3023 1072 2282
15319 14105 14691
...

output:

272184092
490302289
693226832
818893049
661495133
692471611
93104236
933120595
911015708
21124979
332787868
864062226
15790439
780715997
435136774
557127791
723051063
223892080
177657330
953405498
415965440
160709439
644690098
261001437
18565111
85461772
156778283
42075254
374347304
662185953
317581...

result:

ok 200000 numbers

Test #6:

score: 0
Accepted
time: 2508ms
memory: 28644kb

input:

98 200000
100000 1 100000
6502 2213 2935
53997 42038 43908
68958 14314 53993
93884 68506 93377
82405 10861 21708
23366 7085 20254
93187 24336 32214
20435 10610 14280
55096 24827 28554
1180 778 1085
88284 27689 52452
31269 3094 22525
97557 3746 53743
18040 3031 10427
74201 6458 44896
45123 31566 3208...

output:

299469104
412714187
706251591
498995824
849518690
594078846
1137706
886819963
305659464
340273458
447425568
903159307
20895823
307953373
607502478
363101515
319966746
28185723
953301165
497818789
673036729
400321040
63543866
225938391
137232717
340210343
956434579
237992806
785603788
403720719
96079...

result:

ok 200000 numbers

Test #7:

score: 0
Accepted
time: 2515ms
memory: 28812kb

input:

500 200000
99997 1 99997
78213 33719 64821
1396 1047 1395
14412 9659 14031
74860 55275 64135
55715 28404 50067
7386 607 6964
34958 5992 15255
2934 51 1363
93454 2236 92241
38405 754 10470
73751 13138 15100
51258 1006 14307
25070 7424 18428
5324 3084 5227
22918 16101 21684
51320 38369 48987
26684 111...

output:

252778910
111426105
701583307
553569963
387775892
511901999
541643031
970331194
205083058
802113386
604856794
657158366
780477337
105521047
57724931
418848968
798604108
354526444
278085490
625641342
599735846
322012815
155451652
615915800
856322456
713579183
807993503
265439383
383115889
426203484
9...

result:

ok 200000 numbers

Test #8:

score: 0
Accepted
time: 2507ms
memory: 28808kb

input:

100000 200000
99998 1 99998
96151 32977 91203
60890 2251 35995
20635 2141 3071
55922 2510 18019
98176 4442 88869
52460 4447 29495
12137 7559 10840
98573 44540 83623
97746 11584 25007
36426 2873 14990
24943 12719 18809
16993 9201 13141
97443 6338 46858
34298 5432 9018
59839 11729 48921
98430 13985 79...

output:

841597075
711844320
3872626
258971814
916448182
376902454
214439846
516524667
12565462
593343986
765301233
289360957
973382368
682581353
540350170
404545418
487350501
223973170
978756180
43702310
852725195
348294897
373661231
110467120
660467574
88219309
77591540
516259330
294771966
876754578
458250...

result:

ok 200000 numbers

Test #9:

score: 0
Accepted
time: 2508ms
memory: 28592kb

input:

99757 200000
76726 28599 64201
82850 34021 39073
29863 8203 23904
35988 11985 12593
43319 27500 38958
78278 12475 25225
17700 11627 17338
56346 7288 54424
9346 7674 7988
90029 25396 47454
62354 26629 38409
69069 40723 62184
10371 1581 5929
68732 31729 68727
28969 13819 21057
19562 7882 12799
13436 6...

output:

486097848
395462401
22697306
295824305
77033503
580200446
353406119
720973639
82928165
642604900
580203461
423966990
921604386
844060922
300227104
535787881
272034989
95161174
177863751
146282542
134251145
887575107
216955145
629132849
719201063
261579247
617938635
61401190
393884824
683038214
98998...

result:

ok 200000 numbers

Test #10:

score: 0
Accepted
time: 2497ms
memory: 28804kb

input:

70260 200000
89582 23838 62054
87607 46903 83341
10588 6256 6429
56067 7208 40950
52354 3626 9997
48338 6996 6996
39490 8872 35167
53320 27943 37587
48678 19442 42927
28514 19261 21644
83066 10407 34659
79096 58695 66506
79715 57047 72719
13361 4654 8311
1861 660 1119
5735 1841 4859
10516 1785 8504
...

output:

23955255
620741283
68596072
460366249
95487260
533838805
959213626
744109917
18289245
183238836
925206658
243300028
744849799
431038711
601084016
241367515
826042638
533923360
337957585
35030172
806921808
309034488
333789951
312306939
476861506
491666243
56741363
134930767
769379137
858380965
340105...

result:

ok 200000 numbers

Test #11:

score: 0
Accepted
time: 2512ms
memory: 28684kb

input:

76029 200000
44048 4683 15494
51202 20518 34418
55059 9655 33866
3940 489 1814
48515 14544 25640
48597 31329 37614
38418 16891 34174
29927 2996 29208
7028 305 1685
90236 38139 70369
19942 6018 6108
65406 11798 57390
26238 12401 18496
67709 50182 55137
68531 37959 53488
47144 37498 40444
86384 9265 7...

output:

136831200
184041279
78599309
197939476
196533215
742722055
866142064
437755777
593338014
259483989
865540968
177783133
953417820
564725643
995708543
88083321
73621656
417977087
904042570
143703647
995508938
645011851
255365073
321399044
837487761
887154556
186005737
421500786
501036041
627812493
213...

result:

ok 200000 numbers

Test #12:

score: 0
Accepted
time: 2487ms
memory: 28500kb

input:

86508 200000
87534 9886 14476
75656 44553 58084
35 12 26
64612 21802 28652
15936 2879 5724
80769 52539 56397
17248 8644 13985
63468 34993 37935
40247 11944 28887
33758 12831 14041
39244 11345 26887
92285 9573 57891
87769 7836 71217
33206 16610 32989
37829 2913 28674
81784 550 80281
84927 54784 58806...

output:

414798745
836413601
173142698
19429822
341878514
274026325
350576270
206150375
807679601
773485637
838674732
765095468
294225636
746738748
502691349
651257222
168991858
992447013
781966178
178994065
730889359
389316866
806038404
798179478
751609084
421880807
536705767
347429113
435105191
522445774
3...

result:

ok 200000 numbers

Test #13:

score: 0
Accepted
time: 2496ms
memory: 28808kb

input:

94887 200000
41580 26124 31456
54015 6509 42800
19490 7897 7933
23003 4742 14753
5656 547 5624
73865 71253 73021
37578 11230 30606
85420 22438 60018
62701 2647 24572
5927 2177 2672
3055 275 1858
66296 45668 52410
37233 1551 27036
1754 331 1327
78724 9595 22604
32283 23567 25470
92067 3662 55730
5336...

output:

770402473
408968490
318327293
929442170
700705356
789583372
78022634
236251745
721359327
774082769
448475859
116261800
15120145
202325787
22935809
203424122
803629556
395090039
319381839
272744470
996170780
571943210
37350692
151227599
641165632
727572155
326493923
150460832
751074441
247521695
6907...

result:

ok 200000 numbers

Test #14:

score: -100
Time Limit Exceeded

input:

16194 200000
72886 1 72886
8516 1 8516
88928 1 88928
83229 1 83229
99413 1 99413
80348 1 80348
34640 1 34640
89368 1 89368
49346 1 49346
12227 1 12227
18122 1 18122
47967 1 47967
34730 1 34730
93969 1 93969
52758 1 52758
58964 1 58964
43533 1 43533
75663 1 75663
52013 1 52013
13354 1 13354
7139 1 71...

output:

886959128
506083993
218488598
438649157
85271713
721909951
297373797
220801175
764073892
407745691
803342013
56121715
426674810
40459469
538262952
180010139
301467757
823169542
773949565
772016689
95553041
500817318
599561674
587816650
719419296
662280286
278305040
614870049
10532787
265578187
19623...

result: