70202023-12-27 14:22:44sai1997Negáló rendezés (55 pont)cpp11Accepted 55/5554ms13568 KiB
#include <iostream>
#include <vector>
#include <unordered_map>
#include <algorithm>
#include <cstdint>

std::vector<int> beolvas(std::istream &be) {
    int n;
    be >> n;

    std::vector<int> v(n);
    for (auto i = 0; i < n; i++) {
        be >> v[i];
    }

    return v;
}

void feldolgoz(const std::vector<int> &v) {
    const auto min = *std::min_element(v.cbegin(), v.cend());

    std::unordered_map<int, uint64_t> db;
    for (auto x: v) {
        db[x]++;
    }

    uint64_t c = 1;
    for (const auto &p : db) {
        if (p.first != min) {
            c = (c * (p.second + 1)) % 1000000007ULL;
        }
    }

    std::cout << c << std::endl;
}

int main() {
    const auto v = beolvas(std::cin);
    feldolgoz(v);

    return 0;
}

SubtaskSumTestVerdictTimeMemory
base55/55
1Accepted0/03ms1964 KiB
2Accepted0/043ms5836 KiB
3Accepted2/23ms2180 KiB
4Accepted2/23ms2264 KiB
5Accepted2/23ms2400 KiB
6Accepted2/23ms2636 KiB
7Accepted3/33ms2852 KiB
8Accepted2/23ms3056 KiB
9Accepted3/33ms3468 KiB
10Accepted3/348ms13408 KiB
11Accepted3/354ms13568 KiB
12Accepted3/337ms4264 KiB
13Accepted3/335ms4264 KiB
14Accepted3/341ms6176 KiB
15Accepted3/337ms4688 KiB
16Accepted3/343ms7892 KiB
17Accepted3/343ms9564 KiB
18Accepted3/339ms5852 KiB
19Accepted3/343ms7724 KiB
20Accepted3/341ms7308 KiB
21Accepted3/335ms5624 KiB
22Accepted3/337ms5368 KiB