64552023-12-01 12:01:18GervidSzomjas állatokcpp17Accepted 100/1003ms4444 KiB
#include <iostream>
#include <queue>

using namespace std;

int main()
{
    int n, i, current;
    cin >> n;

	priority_queue<int, vector<int>, greater<>> atriver;
	atriver.push(10000000);

	for (i = 0; i < n; i++)
	{
		cin >> current;

		while (atriver.top() < current)
		{
			atriver.pop();
		}

		atriver.push(current);
	}

	cout << atriver.size()-1;
}
SubtaskSumTestVerdictTimeMemory
subtask10/0
1Accepted3ms1820 KiB
2Accepted3ms2056 KiB
subtask25/5
3Accepted3ms2248 KiB
4Accepted3ms2432 KiB
5Accepted3ms2668 KiB
subtask320/20
6Accepted3ms2908 KiB
7Accepted3ms3092 KiB
8Accepted3ms3304 KiB
9Accepted3ms3524 KiB
10Accepted3ms3576 KiB
subtask425/25
11Accepted3ms3812 KiB
12Accepted3ms4056 KiB
13Accepted3ms4056 KiB
14Accepted3ms4184 KiB
15Accepted3ms4112 KiB
subtask520/20
16Accepted3ms4348 KiB
17Accepted3ms4348 KiB
18Accepted3ms4440 KiB
19Accepted3ms4440 KiB
20Accepted3ms4332 KiB
subtask630/30
21Accepted3ms4324 KiB
22Accepted3ms4320 KiB
23Accepted3ms4204 KiB
24Accepted3ms4216 KiB
25Accepted3ms4312 KiB
26Accepted3ms4444 KiB