79482024-01-12 08:15:43csaron71Negáló rendezés (55 pont)cpp17Wrong answer 14/5570ms19896 KiB
#include <bits/stdc++.h>

using namespace std;


vector<long long> szamok(10e5+1, 1);
long long nagy=10e9+7;

int main()
{
    long long n;
    cin >> n;
    for (long long i=0; i<n; i++) {
        long long x;
        cin >> x;
        szamok[x]++;
    }

    bool volt=false;
    long long vege=1;
    for (long long i=0; i<10e5+1; i++) {
        if (volt==true) {
            vege*=szamok[i]%nagy;
            vege%=nagy;
        }
        else if (szamok[i]>1) {
            volt=true;
        }
    }
    cout << vege << "\n";
    return 0;
}
SubtaskSumTestVerdictTimeMemory
base14/55
1Accepted0/035ms17480 KiB
2Wrong answer0/070ms17612 KiB
3Accepted2/237ms17820 KiB
4Accepted2/235ms17960 KiB
5Accepted2/235ms18300 KiB
6Accepted2/235ms18384 KiB
7Accepted3/335ms18512 KiB
8Wrong answer0/235ms18728 KiB
9Wrong answer0/335ms18772 KiB
10Wrong answer0/364ms18848 KiB
11Wrong answer0/367ms18848 KiB
12Accepted3/365ms18772 KiB
13Wrong answer0/364ms18768 KiB
14Wrong answer0/367ms18904 KiB
15Wrong answer0/368ms19112 KiB
16Wrong answer0/368ms19196 KiB
17Wrong answer0/368ms19320 KiB
18Wrong answer0/368ms19532 KiB
19Wrong answer0/367ms19896 KiB
20Wrong answer0/365ms19728 KiB
21Wrong answer0/364ms19728 KiB
22Wrong answer0/365ms19624 KiB