Submission
Status:
PP---PP---
Score: 40
User: Nagorn
Problemset: H.Weird Ping-pong
Language: cpp
Time: 0.133 second
Submitted On: 2024-10-15 08:10:21
#include <bits/stdc++.h>
#define int long long
using namespace std;
int32_t main(){
cin.tie(NULL)->sync_with_stdio(false);
int n;
cin >> n;
vector <int> a(n);
for(int i = 0; i < n; i++){
cin >> a[i];
}
sort(a.begin(), a.end());
int ans = 1;
int cnt = 0;
for(int i = 0; i < n; i++){
ans *= (a[i] - cnt);
cnt++;
}
cout << ans;
}