27982023-01-25 17:36:27AblablablaKártyajátékcpp11Time limit exceeded 9/30500ms3400 KiB
#include <bits/stdc++.h>

using namespace std;

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


    int szamlalo = 0;
    for(int i = 0; i < k; i++){
        bool teljesul = false;
        for(int j = i + 1; j < k; j++){
            if(szamok[i] > szamok[j] && szamok[j] != -1){
                teljesul = true;
                szamok[j] = -1;
            }
        }
        if(teljesul){
            szamlalo++;
        }
    }

    cout << szamlalo << "\n";
}
SubtaskSumTestVerdictTimeMemory
base9/30
1Accepted0/03ms1816 KiB
2Time limit exceeded0/0500ms1716 KiB
3Accepted1/12ms2204 KiB
4Accepted1/12ms2408 KiB
5Accepted1/12ms2660 KiB
6Accepted2/23ms2740 KiB
7Accepted2/23ms2736 KiB
8Accepted2/23ms2692 KiB
9Time limit exceeded0/1500ms2372 KiB
10Time limit exceeded0/2486ms2732 KiB
11Time limit exceeded0/3469ms2972 KiB
12Time limit exceeded0/3453ms3156 KiB
13Time limit exceeded0/1460ms3064 KiB
14Time limit exceeded0/2446ms3144 KiB
15Time limit exceeded0/3477ms3172 KiB
16Time limit exceeded0/3469ms3248 KiB
17Time limit exceeded0/3449ms3400 KiB