39492023-03-06 15:09:56kdbNegáló rendezés (55 pont)cpp17Accepted 55/5530ms12468 KiB
#include <iostream>
#include <vector>
#include <unordered_map>
#include <algorithm>
#define ll long long
using namespace std;


int main()
{
    cin.tie(nullptr);
    cout.tie(nullptr);
    ios_base::sync_with_stdio(false);

    int n;
    cin >> n;
    unordered_map<ll, ll>m;
    ll mini = 100001;
    for (size_t i = 0; i < n; i++)
    {
        ll a;
        cin >> a;
        m[a]++;
        mini = min(mini, a);
    }
    ll MOD = 1000000007;
    ll db = 1;
    for (auto i : m)
    {
        if (i.first != mini)
        {
            db = db * (i.second + 1) % MOD;
        }
    }
    cout << db << endl;
}
/*
5
5 1 2 3 2
*/
SubtaskSumTestVerdictTimeMemory
base55/55
1Accepted0/03ms1976 KiB
2Accepted0/023ms5288 KiB
3Accepted2/23ms2320 KiB
4Accepted2/23ms2480 KiB
5Accepted2/22ms2564 KiB
6Accepted2/22ms2564 KiB
7Accepted3/33ms2820 KiB
8Accepted2/23ms2780 KiB
9Accepted3/33ms2852 KiB
10Accepted3/328ms12296 KiB
11Accepted3/330ms12468 KiB
12Accepted3/313ms3456 KiB
13Accepted3/314ms3564 KiB
14Accepted3/318ms4960 KiB
15Accepted3/316ms3888 KiB
16Accepted3/323ms6744 KiB
17Accepted3/324ms8304 KiB
18Accepted3/317ms4684 KiB
19Accepted3/321ms6380 KiB
20Accepted3/319ms6304 KiB
21Accepted3/316ms4656 KiB
22Accepted3/314ms4160 KiB