(#include <bits/stdc++.h>
using namespace std;
const int mod=1000000007;
long long sum=1;
int main() {
int n, k;
cin >> n >> k;
for (int i=n;i>n-k;i--) sum*=i, sum%=mod;
cout << sum%mod;
return 0;
} )
#include <bits/stdc++.h>
using namespace std;
const int mod=1000000007;
long long sum=1;
int main() {
int n, k;
cin >> n >> k;
for (int i=n;i>n-k;i--) sum*=i, sum%=mod;
cout << sum%mod;
return 0;
}
共 2 条回复
(#include <bits/stdc++.h> using namespace std; const int mod=1000000007; long long sum=1; int main() { int n, k; cin >> n >> k; for (int i=n;i>n-k;i--) sum*=i, sum%=mod; cout << sum%mod; return 0; } )
#include <bits/stdc++.h> using namespace std; const int mod=1000000007; long long sum=1; int main() { int n, k; cin >> n >> k; for (int i=n;i>n-k;i--) sum*=i, sum%=mod; cout << sum%mod; return 0; }