Advertisement
tuki2501

C11ID.cpp

Sep 19th, 2022
767
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.40 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3.  
  4. typedef long long ll;
  5.  
  6. const ll MOD = 1000000007;
  7.  
  8. int main() {
  9.     cin.tie(0)->sync_with_stdio(0);
  10.     int n; cin >> n;
  11.     vector<ll> a(n);
  12.     for (auto &i : a) {
  13.         cin >> i;
  14.     }
  15.     sort(a.begin(), a.end());
  16.     ll ans = 1;
  17.     for (int i = 0; i < n; i++) {
  18.         (ans *= (a[i] - i)) %= MOD;
  19.     }
  20.     cout << ans << '\n';
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement