193912025-12-07 19:09:15szabelrNegáló rendezés (55 pont)cpp17Accepted 55/5598ms6452 KiB
// Negáló rendezés.cpp : This file contains the 'main' function. Program execution begins and ends there.
//

#include <iostream>
#include <map>
using namespace std;
int main()
{
    long long n,x,r=1,mini=1000007;
    cin >> n;
    map<long long, long long> key;
    for (int i = 0; i < n; i++) {     
        cin >> x;
        
        mini=min(mini,x);
        
        key[x]++;
    }
    for (auto y : key) {
        //cout << y.second << " ";
        if(y.first!=mini)
            r = (r * (y.second + 1)) % 1000000007;
    }
    cout << r%1000000007;
}

// Run program: Ctrl + F5 or Debug > Start Without Debugging menu
// Debug program: F5 or Debug > Start Debugging menu

// Tips for Getting Started: 
//   1. Use the Solution Explorer window to add/manage files
//   2. Use the Team Explorer window to connect to source control
//   3. Use the Output window to see build output and other messages
//   4. Use the Error List window to view errors
//   5. Go to Project > Add New Item to create new code files, or Project > Add Existing Item to add existing code files to the project
//   6. In the future, to open this project again, go to File > Open > Project and select the .sln file
SubtaskSumTestVerdictTimeMemory
base55/55
1Accepted0/01ms316 KiB
2Accepted0/065ms2604 KiB
3Accepted2/21ms316 KiB
4Accepted2/21ms316 KiB
5Accepted2/21ms316 KiB
6Accepted2/21ms316 KiB
7Accepted3/31ms316 KiB
8Accepted2/21ms316 KiB
9Accepted3/32ms316 KiB
10Accepted3/385ms5944 KiB
11Accepted3/398ms6452 KiB
12Accepted3/335ms400 KiB
13Accepted3/332ms396 KiB
14Accepted3/352ms1656 KiB
15Accepted3/345ms500 KiB
16Accepted3/365ms2556 KiB
17Accepted3/363ms2868 KiB
18Accepted3/348ms1064 KiB
19Accepted3/364ms2500 KiB
20Accepted3/356ms1724 KiB
21Accepted3/346ms992 KiB
22Accepted3/341ms440 KiB