You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

23 lines
577 B

#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;
}