39482023-03-06 15:07:17kdbNegáló rendezés (55 pont)cpp17Accepted 55/5557ms16036 KiB
#include <iostream>
#include <vector>
#include <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;
    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/03ms1828 KiB
2Accepted0/041ms6860 KiB
3Accepted2/23ms2236 KiB
4Accepted2/23ms2596 KiB
5Accepted2/22ms2540 KiB
6Accepted2/23ms2668 KiB
7Accepted3/33ms2884 KiB
8Accepted2/23ms3088 KiB
9Accepted3/33ms3524 KiB
10Accepted3/352ms14648 KiB
11Accepted3/357ms16036 KiB
12Accepted3/313ms3732 KiB
13Accepted3/313ms3816 KiB
14Accepted3/329ms6488 KiB
15Accepted3/321ms4328 KiB
16Accepted3/341ms8856 KiB
17Accepted3/339ms9540 KiB
18Accepted3/327ms5688 KiB
19Accepted3/341ms8936 KiB
20Accepted3/332ms7128 KiB
21Accepted3/327ms5688 KiB
22Accepted3/318ms4624 KiB