Submission
Status:
PPPPPPPPPP
Score: 100
User: chawinkn
Problemset: H.Weird Ping-pong
Language: cpp
Time: 0.389 second
Submitted On: 2024-10-14 22:01:19
#include <bits/stdc++.h>
using namespace std;
#define ll long long
const ll M = 1e9+7;
int main() {
int n;
cin >> n;
vector<int> a(n);
for (auto& i : a) cin >> i;
sort(a.begin(), a.end());
ll ans=a[0];
for (int i = 1; i < n; i++) ans *= a[i]-i, ans %= M;
cout << ans;
}