74212024-01-08 19:38:06szasztundeNegáló rendezés (55 pont)cpp17Accepted 55/5535ms5508 KiB
#include <iostream>

using namespace std;

long long a[100001]={0};


int main()
{
    long long x,n,mx=0,mn=100001;

    cin>>n;
    for(int i=1;i<=n;i++)
    {
        cin>>x;
        a[x]++;
        if(x<mn) mn=x;
        if(x>mx) mx=x;
    }
    long long db=1;
    for(int i=mn+1;i<=mx;i++)
    {
        if(a[i]>0)
        {
            db=db*(a[i]+1);
            db=db%1000000007;
        }
    }
    cout<<db;
}
SubtaskSumTestVerdictTimeMemory
base55/55
1Accepted0/03ms1880 KiB
2Accepted0/035ms3668 KiB
3Accepted2/23ms2344 KiB
4Accepted2/23ms2568 KiB
5Accepted2/23ms2712 KiB
6Accepted2/23ms2936 KiB
7Accepted3/33ms3168 KiB
8Accepted2/23ms3604 KiB
9Accepted3/34ms4988 KiB
10Accepted3/332ms4976 KiB
11Accepted3/335ms4976 KiB
12Accepted3/335ms3588 KiB
13Accepted3/332ms3660 KiB
14Accepted3/335ms5196 KiB
15Accepted3/334ms5348 KiB
16Accepted3/335ms5272 KiB
17Accepted3/332ms5276 KiB
18Accepted3/335ms5424 KiB
19Accepted3/335ms5408 KiB
20Accepted3/334ms5504 KiB
21Accepted3/332ms5508 KiB
22Accepted3/334ms5400 KiB