45322023-03-29 12:51:25TomaSajtNegáló rendezés (55 pont)cpp17Accepted 55/5554ms13188 KiB
#include <bits/stdc++.h>
using namespace std;
#define speed cin.tie(0); ios::sync_with_stdio(0)
const int mod = 1e9 + 7;

int main() {
    speed;
    int n; cin >> n;
    map<int, int> cnts;
    while (n--) {
        int a; cin >> a;
        cnts[a]++;
    }
    bool first = 1;
    long long res = 1;
    for (auto [x, c] : cnts) {
        if (first) {
            first = 0;
            continue;
        }
        res *= (c + 1);
        res %= mod;
    }
    cout << res;
    return 0;
}
SubtaskSumTestVerdictTimeMemory
base55/55
1Accepted0/03ms1832 KiB
2Accepted0/037ms5760 KiB
3Accepted2/23ms2288 KiB
4Accepted2/23ms2464 KiB
5Accepted2/23ms2664 KiB
6Accepted2/22ms2764 KiB
7Accepted3/33ms3168 KiB
8Accepted2/23ms3320 KiB
9Accepted3/33ms3848 KiB
10Accepted3/350ms12180 KiB
11Accepted3/354ms13188 KiB
12Accepted3/314ms4020 KiB
13Accepted3/313ms4148 KiB
14Accepted3/328ms5964 KiB
15Accepted3/321ms4248 KiB
16Accepted3/339ms7656 KiB
17Accepted3/337ms8384 KiB
18Accepted3/326ms5396 KiB
19Accepted3/337ms7664 KiB
20Accepted3/332ms6392 KiB
21Accepted3/326ms5268 KiB
22Accepted3/319ms4596 KiB