76232024-01-10 09:19:52gyjazminNegáló rendezés (55 pont)cpp17Accepted 55/5563ms12252 KiB

#include <unordered_map>
#include <iostream>
#include <vector>
using namespace std;
/*bool vanbenne(int a) {
    bool vb = false;
    for (int i = 0;i < sz.size();i++) {
        if (sz[i] == a) {
            vb= true;
        }
    }
    return vb;
}
/*int megtalal(int a) {
    for (int i = 0;i < sz.size();i++) {
        if (sz[i].first == a) {
            return i;
        }
    }
}*/
int main()
{
    int n;
    cin >> n;
    int legkisebb = 100001;
    unordered_map<long, long>sz;
    for (int i = 0;i < n;i++) {
        int a;
        cin >> a;
        /*if (!vanbenne(a)) {
            sz.insert({a, 0});
        }*/
        sz[a]++;
        if (a < legkisebb) {
            legkisebb = a;
        }
    }
    long long valasz=1;
    for (auto i : sz) {
        if (i.first != legkisebb) {
            valasz = valasz * (i.second + 1)% 1000000007;
        }
    }
    cout << valasz << endl;
}
SubtaskSumTestVerdictTimeMemory
base55/55
1Accepted0/03ms1816 KiB
2Accepted0/046ms5104 KiB
3Accepted2/23ms2240 KiB
4Accepted2/23ms2216 KiB
5Accepted2/23ms2296 KiB
6Accepted2/23ms2424 KiB
7Accepted3/33ms2672 KiB
8Accepted2/23ms2760 KiB
9Accepted3/33ms3036 KiB
10Accepted3/348ms12252 KiB
11Accepted3/363ms12148 KiB
12Accepted3/335ms2936 KiB
13Accepted3/334ms2936 KiB
14Accepted3/341ms4452 KiB
15Accepted3/337ms3136 KiB
16Accepted3/346ms5904 KiB
17Accepted3/345ms7464 KiB
18Accepted3/341ms4108 KiB
19Accepted3/346ms5724 KiB
20Accepted3/343ms5448 KiB
21Accepted3/337ms4060 KiB
22Accepted3/337ms3328 KiB