126622024-12-27 18:46:27BucsMateNegáló rendezés (55 pont)cpp17Accepted 55/5535ms804 KiB
#include <iostream>

using namespace std;

const int MOD = 1000000007;

int main()
{
    int N, frekv[100001] = {};
    cin >> N;
    int temp;
    for(int i = 0; i < N; i++){
        cin >> temp;
        frekv[temp]++;
    }

    long long res = 1;
    bool elso = false;
    for(int i = 0; i <= 100000; i++){
        if(elso){
            res = (res * (frekv[i] + 1)) % MOD;
        }
        else if(frekv[i] != 0){
            elso = true;
        }
    }

    cout << res;
    return 0;
}
SubtaskSumTestVerdictTimeMemory
base55/55
1Accepted0/02ms568 KiB
2Accepted0/035ms788 KiB
3Accepted2/22ms568 KiB
4Accepted2/22ms748 KiB
5Accepted2/22ms572 KiB
6Accepted2/22ms568 KiB
7Accepted3/32ms568 KiB
8Accepted2/22ms568 KiB
9Accepted3/32ms572 KiB
10Accepted3/332ms788 KiB
11Accepted3/335ms792 KiB
12Accepted3/334ms792 KiB
13Accepted3/332ms788 KiB
14Accepted3/334ms788 KiB
15Accepted3/334ms792 KiB
16Accepted3/334ms792 KiB
17Accepted3/332ms792 KiB
18Accepted3/335ms784 KiB
19Accepted3/334ms788 KiB
20Accepted3/334ms788 KiB
21Accepted3/330ms804 KiB
22Accepted3/334ms568 KiB