63352023-11-20 10:55:29GhostSzomjas állatokcpp17Accepted 100/1006ms4332 KiB
#include <iostream>
#include <vector>
#include <algorithm>

using namespace std;

int main()
{
    int n, i, s;
    cin >> n;
    int out = n;
    vector<int> animals(n);
    for (i = 0; i < n; i++) {
        cin >> animals[i];
    }

    for (i = 1; i < n; i++) {
        for (int j = 0; j < i; j++) {
            if (animals[j] != -1 && animals[j] < animals[i]) {
                animals[j] = -1;
            }
        }
    }

    out -= count(animals.begin(), animals.end(), -1);
    cout << out;
}
SubtaskSumTestVerdictTimeMemory
subtask10/0
1Accepted3ms1812 KiB
2Accepted3ms2060 KiB
subtask25/5
3Accepted3ms2312 KiB
4Accepted3ms2524 KiB
5Accepted3ms2728 KiB
subtask320/20
6Accepted3ms2944 KiB
7Accepted3ms3156 KiB
8Accepted3ms3244 KiB
9Accepted4ms3180 KiB
10Accepted6ms3264 KiB
subtask425/25
11Accepted3ms3504 KiB
12Accepted3ms3476 KiB
13Accepted3ms3480 KiB
14Accepted2ms3592 KiB
15Accepted3ms3584 KiB
subtask520/20
16Accepted3ms3600 KiB
17Accepted3ms3840 KiB
18Accepted4ms3912 KiB
19Accepted4ms3916 KiB
20Accepted3ms3916 KiB
subtask630/30
21Accepted2ms3912 KiB
22Accepted3ms4028 KiB
23Accepted3ms4156 KiB
24Accepted4ms4212 KiB
25Accepted4ms4332 KiB
26Accepted3ms4220 KiB