'commit'
This commit is contained in:
23
TangDou/LuoGuBook/P1866.cpp
Normal file
23
TangDou/LuoGuBook/P1866.cpp
Normal file
@@ -0,0 +1,23 @@
|
||||
#include <bits/stdc++.h>
|
||||
|
||||
using namespace std;
|
||||
typedef long long LL;
|
||||
const int MOD = 1000000007;
|
||||
const int N = 51; //50只兔子是上限值
|
||||
int n; //具体是几只兔子
|
||||
int nums[N]; //字牌编号
|
||||
|
||||
int main() {
|
||||
LL ans = 1;
|
||||
cin >> n;
|
||||
for (int i = 1; i <= n; i++)cin >> num[i];
|
||||
sort(num + 1, num + 1 + n);//排序,贪心
|
||||
|
||||
for (int i = 1; i <= n; i++) {
|
||||
ans *= (num[i] - i + 1);
|
||||
ans %= MOD; //边乘边模,使用了同余定理
|
||||
}
|
||||
//输出结果
|
||||
cout << ans << endl;
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user