32582023-02-23 13:00:56TuruTamasRészekre (40)cpp17Time limit exceeded 24/40569ms4076 KiB
#include <bits/stdc++.h>
using namespace std;

vector<int> x;
int N;

int main() {
    cin.tie(0); ios::sync_with_stdio(0);
    cin >> N;
    int a;
    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
base24/40
1Accepted0/03ms1892 KiB
2Accepted0/039ms2092 KiB
3Accepted2/23ms2332 KiB
4Accepted2/23ms2548 KiB
5Accepted2/23ms2620 KiB
6Accepted3/33ms2848 KiB
7Accepted3/34ms3060 KiB
8Accepted3/34ms3400 KiB
9Accepted3/39ms3492 KiB
10Accepted3/3172ms3924 KiB
11Accepted3/3435ms3996 KiB
12Time limit exceeded0/3559ms4076 KiB
13Time limit exceeded0/4569ms3060 KiB
14Time limit exceeded0/4528ms3316 KiB
15Time limit exceeded0/5555ms3420 KiB