79112024-01-11 21:01:50zoliNegáló rendezés (55 pont)cpp17Accepted 55/5537ms12532 KiB
#include <iostream>

using namespace std;
const int mod=1000000007;
int n;
int a[100001]={0}; ///elofordulasi
int main()
{
   cin>>n;
   int x, mini=100001, maxi=0;
   for(int i=1;i<=n;i++)
    { cin>>x; a[x]++;
        if(x<mini)mini=x;
        if(x>maxi)maxi=x;
    }
   long long p=1;
   int i=maxi;
   while(i>mini)
   {
       if(a[i]>0) p=(p*((a[i]+1)%mod)%mod);
       i--;
   }
   cout<<p;

    return 0;
}
SubtaskSumTestVerdictTimeMemory
base55/55
1Accepted0/03ms2160 KiB
2Accepted0/037ms3628 KiB
3Accepted2/23ms2864 KiB
4Accepted2/23ms2940 KiB
5Accepted2/23ms2952 KiB
6Accepted2/23ms3208 KiB
7Accepted3/33ms3248 KiB
8Accepted2/23ms3532 KiB
9Accepted3/33ms4328 KiB
10Accepted3/332ms4820 KiB
11Accepted3/337ms5360 KiB
12Accepted3/337ms5428 KiB
13Accepted3/334ms6276 KiB
14Accepted3/337ms7424 KiB
15Accepted3/337ms8288 KiB
16Accepted3/337ms8808 KiB
17Accepted3/335ms9592 KiB
18Accepted3/337ms10240 KiB
19Accepted3/337ms10840 KiB
20Accepted3/335ms11568 KiB
21Accepted3/332ms12000 KiB
22Accepted3/335ms12532 KiB