#298

by asd

Submitted 1 year 3 months ago
Mon May 10 17:57:26 CST 2021
Judger: judger1
Dataset Version: v2

2727 ms / 34108 KB
Final 0
Problem: lss1.dp
Language: GNU C++ 11


#1

467ms / 34108KB / Runtime Error
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 85 24 30
77 67 41 57
40 45 9 32
39 38 24 27
42 30 83 19
59 40 16 34
7 78 31 5
46 22 87 74
30 71 73 25
13 98 74 78
37 62 91 87
75 56 68 56
51 51 53 32
31 67 25 42
38 8 92 8
84 54 88 58
59 10 10 46
47 23 89 22
69 14 31 7
56 63 92 1
38 25 60 11
42 96 84 49
37 92 51 3
22 97 21 75
85 69 100 49
100 54 35 82
89 1 39 19
94 29 68 28
22 8 84 49
15 14 18 11
52 36 17 10
57 20 50 1
9 25 4 99
3 90 10 45
44 94 86 96
4 15 88 24
19 59 1 49
82 99 97 81
58 10 99 90
93 39 23 73
58 91 80 39
89 16 92 59
35 3 12 57
47 29 56 73
34 76 87 63
17 45 43 70
52 23 99 82
77 58 100 22
13 76 90 93
70 4 11 1
90 2 89 62
86 3 24 56
27 89 86 83
33 33 58 18
90 22 55 70
93 69 30 77
50 35 56 26
61 46 13 42
24 40 54 19
30 88 97 80
50 67 38 5<...>
Output

												
Answer

												
Checker Information
Exit code is 11

#1

503ms / 33976KB / Runtime Error
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 191 36 317
943 41 107 289
806 447 649 265
351 371 730 891
549 394 102 7
955 85 624 630
377 967 841 757
440 945 309 932
539 538 324 627
542 930 83 119
659 640 116 834
307 978 931 705
746 22 387 674
830 271 73 925
513 98 574 778
637 162 291 987
575 656 768 356
151 351 53 32
431 967 725 942
338 8 192 108
384 754 288 458
759 210 910 946
947 423 589 222
169 414 31 507
656 763 592 901
538 625 360 411
42 596 484 549
837 292 351 603
22 597 21 375
485 669 200 349
1000 54 735 282
789 901 939 419
894 729 468 128
422 808 484 649
515 814 618 311
452 936 617 310
557 520 250 601
9 225 304 799
703 990 610 845
344 94 486 196
504 315 588 524
619 459 201 449
282 799 797 581
158 10 799 590
293 539 623 473
658 191 180 39
889 816 192 <...>
Output

												
Answer

												
Checker Information
Exit code is 11

#1

2727ms / 34032KB / Runtime Error
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 87154 15952
46246 62369 84818 49148
2747 27584 391 462
66716 48210 88921 22149
6265 83876 838 5011
44397 47470 65428 91154
19009 43713 11115 10179
86588 93408 89131 67802
52855 1167 76195 34192
27379 91623 62186 97132
4204 88941 48706 77955
9672 51418 80319 76052
55630 6065 32281 35882
7886 77203 69770 78401
79455 99657 72763 73676
44400 30842 67769 13956
1324 62348 27660 98264
20561 20489 98990 42924
64592 91555 98257 67601
37482 6752 28901 89310
80797 95914 84369 15846
91549 80456 48458 47057
48969 88921 49833 11585
33879 28319 90608 15253
23514 10529 23438 58016
81903 75971 52847 8778
70492 78129 89875 79077
55639 64529 75988 5020
59279 60613 18349 25265
52221 68124 46917 32713
16306 36450 45802 49029
63328 71619 99170 3357<...>
Output

												
Answer

												
Checker Information
Exit code is 11
#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(scanf("%lld%lld%lld%lld",&a,&b,&c,&d)){
		c--;d--; 
		cout<<C(c+d,c)*qp(a,c)%mod*qp(b,d)%mod<<endl;
	}
}