76302024-01-10 09:44:48AblablablaNegáló rendezés (55 pont)cpp17Wrong answer 18/5546ms5640 KiB
#include <bits/stdc++.h>

using namespace std;

typedef long long ll;

const ll MOD = 1e9 + 7;

int main()
{
    int n;
    cin >> n;

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

    sort(szamok.begin(), szamok.end(), greater<int>());

    vector<int> db;
    db.push_back(1);
    for(int i = 1; i < n; i++){
        if(szamok[i] == szamok[i - 1]){
            db[db.size() - 1]++;
        } else{
            db.push_back(1);
        }
    }

    ll valasz = 1;
    for(int i = 1; i < db.size(); i++){
        valasz *= (ll)(db[i] + 1);
        valasz %= MOD;
    }

    cout << valasz << "\n";
}
SubtaskSumTestVerdictTimeMemory
base18/55
1Accepted0/03ms1808 KiB
2Wrong answer0/046ms3452 KiB
3Accepted2/23ms2268 KiB
4Accepted2/23ms2432 KiB
5Wrong answer0/23ms2680 KiB
6Wrong answer0/23ms2868 KiB
7Wrong answer0/33ms2904 KiB
8Accepted2/23ms3000 KiB
9Accepted3/33ms3096 KiB
10Accepted3/341ms4816 KiB
11Accepted3/346ms4984 KiB
12Wrong answer0/337ms3976 KiB
13Wrong answer0/335ms4088 KiB
14Wrong answer0/343ms4788 KiB
15Accepted3/341ms4632 KiB
16Wrong answer0/346ms5272 KiB
17Wrong answer0/343ms5260 KiB
18Wrong answer0/343ms5000 KiB
19Wrong answer0/346ms5640 KiB
20Wrong answer0/343ms5404 KiB
21Wrong answer0/339ms5144 KiB
22Wrong answer0/341ms5012 KiB