1 solutions
-
0
#include<bits/stdc++.h> using namespace std; typedef long long LL; const int N=1010,P=10007; LL c[N][N]; int main() { int a,b,k,n,m; cin>>a>>b>>k>>n>>m; for(int i=0;i<N;i++) { for(int j=0;j<=i;j++) { if(!j) c[i][j]=1; else c[i][j]=(c[i-1][j-1]+c[i-1][j])%P; } } LL res=c[k][n]; for(int i=1;i<=n;i++) res=res*a%P; for(int i=1;i<=m;i++) res=res*b%P; cout<<res; return 0; }
- 1
Information
- ID
- 2480
- Time
- 1000ms
- Memory
- 256MiB
- Difficulty
- 5
- Tags
- # Submissions
- 2
- Accepted
- 2
- Uploaded By