32622023-02-23 14:39:11TuruTamasRészekre (40)cpp17Accepted 40/40352ms4488 KiB
#include <bits/stdc++.h>
using namespace std;

vector<int> x;
int N;
int a;
int main() {
    cin.tie(0); ios::sync_with_stdio(0);
    cin >> N;
    cin >> a;
    x.push_back(a);
    for (size_t i = 0; i < N-1; i++)
    {
        cin >> a;
        bool f = false;
        for (int& i : x) {
            if (i < a) {
                f = true;
                i = a;
                break;
            }
        }
        if (!f) {
            x.push_back(a);
        }
    }
    cout << x.size();
}
SubtaskSumTestVerdictTimeMemory
base40/40
1Accepted0/03ms2016 KiB
2Accepted0/028ms2168 KiB
3Accepted2/23ms2372 KiB
4Accepted2/23ms2584 KiB
5Accepted2/23ms2796 KiB
6Accepted3/33ms2996 KiB
7Accepted3/33ms3208 KiB
8Accepted3/34ms3304 KiB
9Accepted3/37ms3308 KiB
10Accepted3/390ms3724 KiB
11Accepted3/3224ms3820 KiB
12Accepted3/3349ms3840 KiB
13Accepted4/4352ms4008 KiB
14Accepted4/4351ms4224 KiB
15Accepted5/5352ms4488 KiB