#19

by asd

Submitted 4 years 10 months 1 day ago
Tue Jan 14 21:45:40 CST 2020
Judger: ZJS
Dataset Version: v0

4405 ms / 32804 KB
Final 50
Problem: lss1.dp
Language: GNU C++ 11


#1

421ms / 32804KB / Accepted
Input
1 35 68 42
59 79 25 70
46 6 65 63
92 62 28 82
37 28 43 96
54 3 5 92
17 22 83 93
27 48 96 19
13 70 39 72
95 36 100 68
34 23 12 4
12 42 65 74
45 48 69 54
60 38 58 63
79 30 42 24
43 91 36 17
43 41 7 89
6 47 49 65
51 71 30 91
49 94 2 7
55 8<...>
Output
392141484
796237269
221949171
507960909
146582013
91294836
959402133
544472058
392312299
727465936
622036361
296986481
541849778
68435793
126377243
976024134
631756300
578939090
113094226
333245833
412576069
397319000
628028412
494710283
858712716
78886286<...>
Answer
392141484
796237269
221949171
507960909
146582013
91294836
959402133
544472058
392312299
727465936
622036361
296986481
541849778
68435793
126377243
976024134
631756300
578939090
113094226
333245833
412576069
397319000
628028412
49471<...>
Checker Information
100 tokens

#2

452ms / 32800KB / Accepted
Input
69 64 71 74
81 3 86 93
100 3 28 14
25 44 26 28
82 62 73 24
94 6 33 4
43 93 32 26
1 65 87 23
75 14 61 88
34 36 71 71
68 97 61 12
95 41 51 86
26 20 25 96
3 59 95 77
94 79 67 72
65 19 85 52
88 1 53 20
58 11 27 61
28 77 16 71
10 65 59 44
88<...>
Output
270766063
899563774
664152661
157881190
932645772
376606265
61674287
238784236
808237758
260641984
234608113
483465633
910242723
624633530
79004961
830954378
785264876
873736359
935738630
289307465
695350815
896363123
150603502
368617455
657595129
99145031<...>
Answer
270766063
899563774
664152661
157881190
932645772
376606265
61674287
238784236
808237758
260641984
234608113
483465633
910242723
624633530
79004961
830954378
785264876
873736359
935738630
289307465
695350815
896363123
150603502
36861<...>
Checker Information
100 tokens

#3

421ms / 32800KB / Accepted
Input
27 36 84 37
30 54 39 86
60 24 49 25
56 45 67 58
26 12 27 19
97 50 2 56
43 65 16 85
97 43 14 76
7 27 73 49
6 5 30 74
94 76 13 27
42 37 37 66
53 57 95 15
56 83 39 37
42 31 32 16
87 38 12 26
35 63 51 91
53 17 54 94
55 34 63 9
57 4 35 4
14 <...>
Output
24971033
117452597
596827600
384089337
752903676
91185332
464160560
122839623
582590060
857250154
946724592
765712665
311711114
656572517
441312022
312098791
119333708
409448351
166344562
499795089
155839901
701925573
831295404
566653045
803500287
47248259<...>
Answer
24971033
117452597
596827600
384089337
752903676
91185332
464160560
122839623
582590060
857250154
946724592
765712665
311711114
656572517
441312022
312098791
119333708
409448351
166344562
499795089
155839901
701925573
831295404
56665<...>
Checker Information
100 tokens

#4

437ms / 32804KB / Accepted
Input
74 96 1 10
69 73 62 90
27 69 32 59
80 75 23 11
92 83 53 11
65 75 65 96
75 61 56 3
48 23 22 73
96 6 90 78
55 44 51 95
40 73 13 82
68 63 13 29
24 9 16 9
87 5 35 60
7 46 59 20
93 68 1 67
75 57 33 88
23 84 22 48
49 84 77 32
77 19 83 24
57 8<...>
Output
976742326
751783569
585549793
245367053
804979009
691093218
982360358
482938323
382602839
107098426
713747675
222754184
682753635
828212464
485993129
938663648
350637952
421622729
510126937
591431182
505810297
733234721
230111126
623428382
778798613
255635<...>
Answer
976742326
751783569
585549793
245367053
804979009
691093218
982360358
482938323
382602839
107098426
713747675
222754184
682753635
828212464
485993129
938663648
350637952
421622729
510126937
591431182
505810297
733234721
230111126
623<...>
Checker Information
100 tokens

#5

467ms / 32800KB / Accepted
Input
90 76 71 46
66 34 50 51
33 8 83 15
83 23 68 97
88 32 42 11
39 22 80 6
47 9 48 52
23 90 60 77
29 56 87 67
78 54 61 15
32 62 4 49
7 98 56 83
82 97 22 53
25 48 56 22
75 77 36 19
54 75 99 60
89 44 36 23
81 48 33 54
2 51 79 27
64 56 100 62
4<...>
Output
176905506
870801118
906115698
733670767
607907983
89891823
944057710
457789767
46585309
662184636
899253075
220905081
403701566
87517758
985225739
935732882
351514769
449373780
462609413
795596467
17798909
335162437
623362126
500881689
323649575
340372727
<...>
Answer
176905506
870801118
906115698
733670767
607907983
89891823
944057710
457789767
46585309
662184636
899253075
220905081
403701566
87517758
985225739
935732882
351514769
449373780
462609413
795596467
17798909
335162437
623362126
5008816<...>
Checker Information
100 tokens

#6

453ms / 32800KB / Accepted
Input
8 23 55 9
91 45 39 46
24 5 55 40
82 25 79 26
95 24 34 31
46 88 47 31
90 51 17 6
98 36 64 39
9 25 31 10
73 21 75 38
62 35 56 94
76 85 7 57
33 42 20 83
84 80 80 85
19 26 37 68
78 20 29 38
96 57 92 38
33 94 2 61
8 76 81 37
91 20 75 85
30 5<...>
Output
794882784
677105194
841835616
578735890
163638462
753900909
945425906
588750030
118090939
154942786
230137440
110693109
991316605
862993161
357279745
622681815
178778159
495229426
822515144
47670019
151256546
157591029
956777411
25960797
139980810
85163292<...>
Answer
794882784
677105194
841835616
578735890
163638462
753900909
945425906
588750030
118090939
154942786
230137440
110693109
991316605
862993161
357279745
622681815
178778159
495229426
822515144
47670019
151256546
157591029
956777411
2596<...>
Checker Information
100 tokens

#7

421ms / 32804KB / Accepted
Input
62 97 94 68
39 71 39 47
72 18 56 77
34 59 53 61
2 27 66 56
49 94 60 35
34 94 93 74
12 91 4 38
99 28 69 95
48 80 49 90
76 70 32 50
100 37 50 99
55 32 44 24
68 86 35 62
67 5 94 17
85 24 9 54
70 49 68 93
91 15 12 31
100 5 44 28
59 7 96 75
<...>
Output
157690396
828830545
329011036
384052780
290578834
684863916
756133417
352301689
504599602
306083456
313644600
362700960
929098551
235722944
339373824
105079594
931596363
343589431
867337684
239140292
741712240
862709035
339588473
886852585
211832207
590422<...>
Answer
157690396
828830545
329011036
384052780
290578834
684863916
756133417
352301689
504599602
306083456
313644600
362700960
929098551
235722944
339373824
105079594
931596363
343589431
867337684
239140292
741712240
862709035
339588473
886<...>
Checker Information
100 tokens

#8

483ms / 32800KB / Accepted
Input
67 90 30 24
71 33 57 88
84 23 67 40
92 6 54 61
30 88 87 60
57 46 18 43
67 55 53 89
32 20 61 34
99 77 68 39
8 54 21 15
43 23 17 70
48 61 64 8
44 18 31 94
18 27 15 77
93 72 21 35
94 67 55 65
13 1 76 65
80 77 52 1
62 90 78 44
45 35 73 86
4<...>
Output
648473591
307721416
401623152
972351988
270015268
854013882
80279035
827377694
506213725
762133871
528227028
970997175
97685887
206920131
313270681
261998738
163626502
129288777
436454695
136546740
131047984
18606209
552141288
372648816
462677732
779453311<...>
Answer
648473591
307721416
401623152
972351988
270015268
854013882
80279035
827377694
506213725
762133871
528227028
970997175
97685887
206920131
313270681
261998738
163626502
129288777
436454695
136546740
131047984
18606209
552141288
372648<...>
Checker Information
100 tokens

#9

467ms / 32800KB / Accepted
Input
34 41 46 79
95 69 1 86
82 49 86 34
73 11 57 33
36 7 2 83
38 28 72 61
96 34 69 44
12 43 4 72
94 13 35 80
59 35 62 31
44 92 7 27
85 20 28 89
25 36 94 25
28 68 83 95
90 87 47 6
60 51 38 41
4 78 57 79
26 12 1 43
16 17 96 44
42 69 7 5
14 26 <...>
Output
298737236
891657818
842564622
391939542
747396963
327804093
168430539
203042933
401381324
135005211
474132422
299633951
581246462
130347150
846934267
118962096
469248859
207793687
539861650
60492651
581943223
402139771
453897067
30204327
540634271
73105756<...>
Answer
298737236
891657818
842564622
391939542
747396963
327804093
168430539
203042933
401381324
135005211
474132422
299633951
581246462
130347150
846934267
118962096
469248859
207793687
539861650
60492651
581943223
402139771
453897067
3020<...>
Checker Information
100 tokens

#10

546ms / 32804KB / Accepted
Input
11 9 16 89
8 98 100 41
86 38 5 55
13 14 93 100
30 52 84 83
65 1 34 38
11 69 58 84
33 42 9 69
2 100 85 38
93 57 84 70
11 13 88 41
16 64 36 21
35 75 78 98
87 79 34 54
50 76 35 25
93 25 85 13
14 56 23 5
61 85 74 63
23 98 54 23
7 18 38 51
3<...>
Output
312652206
878051179
514217180
543718402
127476672
742705820
928776412
534243745
4215583
565916656
968191410
620670561
349180778
220975532
138943626
371385836
864210749
127030128
471670564
907740035
908939095
569082477
600366636
48517893
571101324
791989563<...>
Answer
312652206
878051179
514217180
543718402
127476672
742705820
928776412
534243745
4215583
565916656
968191410
620670561
349180778
220975532
138943626
371385836
864210749
127030128
471670564
907740035
908939095
569082477
600366636
48517<...>
Checker Information
100 tokens

#11

484ms / 32804KB / Accepted
Input
1 1 1 1
1 1 1 2
1 1 1 3
1 1 2 1
1 1 2 2
1 1 2 3
1 1 3 1
100 100 100 100
100 100 1 1
100 100 100 1
100 100 1 100
1 100 100 100
100 1 100 100
Output
1
1
1
1
2
3
1
314203864
1
214240902
214240902
187867257
187867257
Answer
1
1
1
1
2
3
1
314203864
1
214240902
214240902
187867257
187867257
Checker Information
13 tokens

#1

546ms / 32804KB / Accepted
Input
501 335 468 42
359 479 725 170
146 706 465 963
492 962 828 282
437 828 943 996
154 903 605 392
717 422 383 293
727 448 896 719
913 870 539 772
895 36 300 668
334 323 812 704
712 142 665 674
645 548 869 254
860 38 758 663
779 530 742 724
843 <...>
Output
499672981
982386899
580444201
448006111
541471797
282568654
604513589
26365520
493827604
406335793
668509038
814759566
567465375
546187483
851976275
326269265
720573069
585589055
125348379
621499623
433529295
241588078
802824131
461853567
630853665
5112475<...>
Answer
499672981
982386899
580444201
448006111
541471797
282568654
604513589
26365520
493827604
406335793
668509038
814759566
567465375
546187483
851976275
326269265
720573069
585589055
125348379
621499623
433529295
241588078
802824131
4618<...>
Checker Information
1000 tokens

#2

546ms / 32800KB / Accepted
Input
426 389 117 67
983 451 611 102
755 39 194 622
639 281 896 594
884 346 421 168
391 834 697 866
184 840 190 633
680 754 130 818
146 253 601 614
964 319 152 862
477 555 908 814
265 430 212 618
699 943 532 967
258 588 156 523
511 763 465 159
166<...>
Output
810067742
704039572
463510605
100460618
720108484
935552393
520287368
398596248
867265431
87013686
822160343
874104196
450418811
458957347
348605268
323454946
822575760
451468632
652550152
368982858
81691123
313611310
827406614
78968706
265640589
327915977<...>
Answer
810067742
704039572
463510605
100460618
720108484
935552393
520287368
398596248
867265431
87013686
822160343
874104196
450418811
458957347
348605268
323454946
822575760
451468632
652550152
368982858
81691123
313611310
827406614
78968<...>
Checker Information
1000 tokens

#3

530ms / 32800KB / Accepted
Input
318 118 64 16
539 644 152 1000
13 888 455 783
175 838 923 913
852 719 809 92
212 853 624 278
16 2 590 231
922 30 729 488
489 328 864 988
476 847 715 478
620 840 832 83
407 363 648 170
562 906 753 561
551 442 381 721
952 125 739 340
626 990 9<...>
Output
122330016
382351648
364972353
232540432
450099641
628273618
252156766
837483541
838177780
29062477
618934896
941942371
104601364
667690690
489068281
454888501
268184234
980039877
884238370
312621013
422133643
557657642
307141946
848558708
792869818
9214646<...>
Answer
122330016
382351648
364972353
232540432
450099641
628273618
252156766
837483541
838177780
29062477
618934896
941942371
104601364
667690690
489068281
454888501
268184234
980039877
884238370
312621013
422133643
557657642
307141946
8485<...>
Checker Information
1000 tokens

#4

421ms / 32804KB / Accepted
Input
128 602 780 922
794 353 212 128
14 79 936 640
803 617 160 145
774 99 507 314
752 825 906 828
867 190 653 873
677 444 980 419
782 853 961 184
935 51 397 956
747 451 199 423
347 527 996 337
252 571 627 299
379 296 265 864
877 808 29 381
720 17<...>
Output
810737000
6072388
358008069
883351617
467706485
266229586
397910048
955438350
286194146
313063628
620886687
61840440
56226693
297301221
851381416
232677353
654634672
354840756
846128679
638231288
338759986
432870156
19152563
138747715
195281991
977331495
4<...>
Answer
810737000
6072388
358008069
883351617
467706485
266229586
397910048
955438350
286194146
313063628
620886687
61840440
56226693
297301221
851381416
232677353
654634672
354840756
846128679
638231288
338759986
432870156
19152563
13874771<...>
Checker Information
1000 tokens

#5

468ms / 32804KB / Accepted
Input
983 506 418 673
539 611 254 829
496 483 76 240
557 106 149 968
186 294 666 1
171 117 430 563
34 499 131 573
426 365 700 681
273 247 739 880
637 563 205 743
714 475 914 442
83 241 417 744
424 196 467 143
870 350 239 874
701 429 550 480
894 66<...>
Output
957950043
148468737
669126996
789018426
15012573
817399004
892890330
400471634
779995239
586380616
118500725
325329538
437664746
644651843
566036758
11004621
705513429
859188659
129777313
591181001
486359982
994542683
652192601
974233741
912008797
17256377<...>
Answer
957950043
148468737
669126996
789018426
15012573
817399004
892890330
400471634
779995239
586380616
118500725
325329538
437664746
644651843
566036758
11004621
705513429
859188659
129777313
591181001
486359982
994542683
652192601
97423<...>
Checker Information
1000 tokens

#6

499ms / 32804KB / Accepted
Input
421 148 113 389
56 257 575 456
602 629 764 862
189 530 570 911
569 233 887 16
885 529 613 308
222 217 529 203
207 968 609 587
82 275 495 220
366 983 747 136
18 888 257 675
872 793 830 559
677 157 801 979
713 237 799 981
250 418 199 838
694 9<...>
Output
671691023
844884484
455266355
514404676
29697188
604646657
239061959
437833503
645181134
74485845
813474239
258946384
524186402
235948891
472023013
219920811
936300525
683726954
938301202
471040000
66607766
62709124
373109884
70229282
375526098
335110504
7<...>
Answer
671691023
844884484
455266355
514404676
29697188
604646657
239061959
437833503
645181134
74485845
813474239
258946384
524186402
235948891
472023013
219920811
936300525
683726954
938301202
471040000
66607766
62709124
373109884
7022928<...>
Checker Information
1000 tokens

#7

515ms / 32800KB / Accepted
Input
313 971 450 118
184 795 71 209
884 396 103 715
9 848 633 278
969 659 449 152
102 669 774 432
773 913 263 333
549 862 186 529
505 827 509 742
698 720 233 208
329 554 27 123
995 744 292 494
949 716 372 393
82 164 42 730
219 634 623 814
150 272<...>
Output
646867169
50641214
373122216
274207774
757868182
643888923
776511689
895602331
92857370
791800922
855270206
228151265
843580128
383667476
302361352
459151081
625332833
841838795
455409516
55175081
210980387
811223117
786988649
837845645
891699977
2007822
5<...>
Answer
646867169
50641214
373122216
274207774
757868182
643888923
776511689
895602331
92857370
791800922
855270206
228151265
843580128
383667476
302361352
459151081
625332833
841838795
455409516
55175081
210980387
811223117
786988649
837845<...>
Checker Information
1000 tokens

#8

530ms / 32800KB / Accepted
Input
779 996 228 299
787 2 701 64
766 784 414 399
818 757 215 452
452 740 616 129
822 346 530 380
209 346 500 761
772 157 47 210
710 910 740 676
233 845 164 340
192 154 472 642
58 389 459 805
119 187 836 359
714 4 128 673
248 978 383 930
320 156 <...>
Output
566594372
381371637
794617701
136533962
100365527
929122893
649197222
120803264
435027852
290834409
224897396
415154437
37689013
738184747
374581995
328383143
613324020
744835801
72697835
499915603
779717930
964543209
71158891
53531431
709918811
691251070
<...>
Answer
566594372
381371637
794617701
136533962
100365527
929122893
649197222
120803264
435027852
290834409
224897396
415154437
37689013
738184747
374581995
328383143
613324020
744835801
72697835
499915603
779717930
964543209
71158891
535314<...>
Checker Information
1000 tokens

#9

546ms / 32800KB / Accepted
Input
507 369 464 837
985 925 257 845
848 145 464 746
744 456 422 595
112 997 638 131
997 871 329 147
153 860 857 913
221 7 642 880
42 116 669 720
827 7 415 999
327 23 289 320
855 760 282 59
475 305 138 317
834 667 584 746
849 548 23 400
515 35 82<...>
Output
855466502
557821828
602475739
258708261
399888748
400954350
452142422
808545832
471575952
907963963
321058285
468826228
728049930
806551771
943746589
179847081
942088198
989681965
553867656
638578363
472887995
266846794
423403064
926229936
467007910
641150<...>
Answer
855466502
557821828
602475739
258708261
399888748
400954350
452142422
808545832
471575952
907963963
321058285
468826228
728049930
806551771
943746589
179847081
942088198
989681965
553867656
638578363
472887995
266846794
423403064
926<...>
Checker Information
1000 tokens

#10

452ms / 32800KB / Accepted
Input
593 889 853 796
922 276 668 615
602 488 238 211
867 649 798 945
527 301 673 965
675 293 218 36
404 919 397 139
262 996 248 561
483 694 151 192
897 284 920 656
559 617 390 173
504 394 313 905
641 695 134 869
224 803 771 357
174 719 302 137
37<...>
Output
952641128
968712548
678013076
992995030
76690773
913220669
521267170
860364794
306295490
354247091
213191539
234470966
242795957
268389252
107328653
405419864
771382118
509958178
676650954
254896842
404923787
809884079
685934671
901756551
778864120
9797053<...>
Answer
952641128
968712548
678013076
992995030
76690773
913220669
521267170
860364794
306295490
354247091
213191539
234470966
242795957
268389252
107328653
405419864
771382118
509958178
676650954
254896842
404923787
809884079
685934671
9017<...>
Checker Information
1000 tokens

#11

483ms / 32804KB / Accepted
Input
1000 1000 1000 1000
1000 1000 1 1
1000 1000 1 1000
1000 1000 1000 1
1000 1 1000 1000
1 1000 1000 1000
Output
287564942
1
247524702
247524702
766158917
766158917
Answer
287564942
1
247524702
247524702
766158917
766158917
Checker Information
6 tokens

#1

4405ms / 32804KB / Time Limit Exceeded
Input
57677 64070 59482 92239
76054 5856 77883 37818
37023 49382 39029 71066
96273 67457 26197 574
79051 68952 23563 75403
70232 41503 23486 47414
40359 96794 28322 48232
68686 90901 58918 29908
8551 31140 83285 88999
17440 59567 73978 8814
31898 14680<...>
Output

												
Answer

												
Checker Information

											
#include <bits/stdc++.h>
using namespace std;
#define ll long long
const ll mod=1e9+7;
const int mx=2000000;

ll f[mx+5];
ll inv[mx+5];

inline ll C(int a,int b){
	return f[a]*inv[b]%mod*inv[a-b]%mod;
}

inline ll qp(ll a,ll b){
	if(b==0){
		return 1;
	}
	ll ans=qp(a,b/2);
	if(b%2){
		return ans*ans%mod*a%mod;
	}else{
		return ans*ans%mod;
	}
}

int main(){
	f[0]=1;
	inv[0]=1;
	for(int i=1;i<=mx;i++){
		f[i]=f[i-1]*i%mod;
		inv[i]=qp(f[i],mod-2);
	}
	
	ll a,b,c,d;
	while(cin>>a>>b>>c>>d){
		c--;d--; 
		cout<<C(c+d,c)*qp(a,c)%mod*qp(b,d)%mod<<endl;
	}
}