32552023-02-23 12:36:35sztomiRészekre (40)cpp11Wrong answer 4/4037ms6036 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.lower_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
2Accepted0/037ms2180 KiB
3Accepted2/23ms2232 KiB
4Accepted2/23ms2448 KiB
5Wrong answer0/23ms2684 KiB
6Wrong answer0/33ms2772 KiB
7Wrong answer0/33ms3052 KiB
8Wrong answer0/34ms3276 KiB
9Wrong answer0/36ms3548 KiB
10Wrong answer0/317ms4444 KiB
11Wrong answer0/328ms4920 KiB
12Wrong answer0/335ms5780 KiB
13Wrong answer0/435ms5840 KiB
14Wrong answer0/435ms5804 KiB
15Wrong answer0/535ms6036 KiB