32542023-02-23 12:35:25sztomiRészekre (40)cpp11Wrong answer 4/4037ms6328 KiB
#include <bits/stdc++.h>

using namespace std;

int main()
{
    ios::sync_with_stdio(false);
    cin.tie(NULL);

    int n;
    cin >> n;
    int akt;
    map<int, int, greater<int>> aktiv;
    for(int i = 0; i < n; i++){
        cin >> akt;
        auto it = aktiv.upper_bound(akt);
        if(it != aktiv.end()){
            it->second--;
            if(it->second == 0){
                aktiv.erase(it);
            }
        }
        aktiv[akt]++;
    }

    cout << aktiv.size() << "\n";
}
SubtaskSumTestVerdictTimeMemory
base4/40
1Accepted0/03ms1828 KiB
2Wrong answer0/037ms2068 KiB
3Accepted2/23ms2132 KiB
4Accepted2/23ms2352 KiB
5Wrong answer0/23ms2564 KiB
6Wrong answer0/33ms2784 KiB
7Wrong answer0/33ms3152 KiB
8Wrong answer0/34ms3384 KiB
9Wrong answer0/34ms3644 KiB
10Wrong answer0/317ms4540 KiB
11Wrong answer0/328ms5092 KiB
12Wrong answer0/335ms5844 KiB
13Wrong answer0/435ms6200 KiB
14Wrong answer0/435ms6328 KiB
15Wrong answer0/535ms6252 KiB