79452024-01-12 08:12:46csaron71Negáló rendezés (55 pont)cpp17Wrong answer 14/5552ms12368 KiB
#include <bits/stdc++.h>

using namespace std;


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

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

    bool volt=false;
    int vege=1;
    for (int 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/020ms9680 KiB
2Wrong answer0/050ms9964 KiB
3Accepted2/220ms10156 KiB
4Accepted2/220ms10340 KiB
5Accepted2/220ms10272 KiB
6Accepted2/220ms10488 KiB
7Accepted3/320ms10692 KiB
8Wrong answer0/220ms10724 KiB
9Wrong answer0/320ms10728 KiB
10Wrong answer0/350ms10888 KiB
11Wrong answer0/352ms11052 KiB
12Accepted3/352ms11080 KiB
13Wrong answer0/350ms11032 KiB
14Wrong answer0/350ms11288 KiB
15Wrong answer0/350ms11500 KiB
16Wrong answer0/350ms11788 KiB
17Wrong answer0/350ms11928 KiB
18Wrong answer0/352ms12140 KiB
19Wrong answer0/350ms12096 KiB
20Wrong answer0/352ms12368 KiB
21Wrong answer0/348ms12244 KiB
22Wrong answer0/350ms12240 KiB