64342023-11-29 11:10:52MCDaveSzomjas állatokcpp17Accepted 100/1003ms4712 KiB
#include <iostream>
#include <queue>

using namespace std;

int main()
{
    int n, temp1;
    cin >> n;
    priority_queue<int, vector<int>, greater<int>> stays;

    for (int i = 0; i < n; i++)
    {
        cin >> temp1;
        stays.push(temp1);
        while (stays.top() != temp1)
        {
            stays.pop();
        }
    }

    cout << stays.size();
}
SubtaskSumTestVerdictTimeMemory
subtask10/0
1Accepted3ms1960 KiB
2Accepted3ms2016 KiB
subtask25/5
3Accepted3ms2208 KiB
4Accepted3ms2460 KiB
5Accepted3ms2616 KiB
subtask320/20
6Accepted3ms2752 KiB
7Accepted3ms2944 KiB
8Accepted3ms3192 KiB
9Accepted3ms3252 KiB
10Accepted3ms3240 KiB
subtask425/25
11Accepted3ms3372 KiB
12Accepted3ms3456 KiB
13Accepted3ms3580 KiB
14Accepted3ms3796 KiB
15Accepted3ms4040 KiB
subtask520/20
16Accepted3ms4092 KiB
17Accepted3ms4204 KiB
18Accepted3ms4456 KiB
19Accepted3ms4544 KiB
20Accepted3ms4548 KiB
subtask630/30
21Accepted3ms4476 KiB
22Accepted3ms4588 KiB
23Accepted3ms4708 KiB
24Accepted3ms4712 KiB
25Accepted3ms4696 KiB
26Accepted3ms4592 KiB