69512023-12-21 08:31:12MagyarKendeSZLGNegáló rendezés (55 pont)cpp17Accepted 55/5579ms13012 KiB
#include <bits/stdc++.h>
using namespace std;
using ll = unsigned long long;

int main() {
    int N;
    cin >> N;
    map<int, int> A;
    for (int i = 0; i < N; i++) {
        int Ai;
        cin >> Ai;
        A[Ai]++;
    }
    int i = 0;
    ll result = 1;
    for (auto entry : A) {
        if (i) {
            result = result * ++entry.second % 1'000'000'007;
        } else i++;
    }
    cout << result;
}
SubtaskSumTestVerdictTimeMemory
base55/55
1Accepted0/03ms1812 KiB
2Accepted0/064ms5628 KiB
3Accepted2/23ms2308 KiB
4Accepted2/23ms2432 KiB
5Accepted2/23ms2512 KiB
6Accepted2/23ms2640 KiB
7Accepted3/33ms2880 KiB
8Accepted2/23ms2960 KiB
9Accepted3/33ms3352 KiB
10Accepted3/372ms11816 KiB
11Accepted3/379ms13012 KiB
12Accepted3/337ms3868 KiB
13Accepted3/335ms3960 KiB
14Accepted3/354ms5800 KiB
15Accepted3/346ms4036 KiB
16Accepted3/364ms7580 KiB
17Accepted3/361ms8012 KiB
18Accepted3/350ms5280 KiB
19Accepted3/363ms7280 KiB
20Accepted3/357ms6392 KiB
21Accepted3/348ms5340 KiB
22Accepted3/343ms4516 KiB