6455 | 2023-12-01 12:01:18 | Gervid | Szomjas állatok | cpp17 | Accepted 100/100 | 3ms | 4444 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;
}
Subtask | Sum | Test | Verdict | Time | Memory | ||
---|---|---|---|---|---|---|---|
subtask1 | 0/0 | ||||||
1 | Accepted | 3ms | 1820 KiB | ||||
2 | Accepted | 3ms | 2056 KiB | ||||
subtask2 | 5/5 | ||||||
3 | Accepted | 3ms | 2248 KiB | ||||
4 | Accepted | 3ms | 2432 KiB | ||||
5 | Accepted | 3ms | 2668 KiB | ||||
subtask3 | 20/20 | ||||||
6 | Accepted | 3ms | 2908 KiB | ||||
7 | Accepted | 3ms | 3092 KiB | ||||
8 | Accepted | 3ms | 3304 KiB | ||||
9 | Accepted | 3ms | 3524 KiB | ||||
10 | Accepted | 3ms | 3576 KiB | ||||
subtask4 | 25/25 | ||||||
11 | Accepted | 3ms | 3812 KiB | ||||
12 | Accepted | 3ms | 4056 KiB | ||||
13 | Accepted | 3ms | 4056 KiB | ||||
14 | Accepted | 3ms | 4184 KiB | ||||
15 | Accepted | 3ms | 4112 KiB | ||||
subtask5 | 20/20 | ||||||
16 | Accepted | 3ms | 4348 KiB | ||||
17 | Accepted | 3ms | 4348 KiB | ||||
18 | Accepted | 3ms | 4440 KiB | ||||
19 | Accepted | 3ms | 4440 KiB | ||||
20 | Accepted | 3ms | 4332 KiB | ||||
subtask6 | 30/30 | ||||||
21 | Accepted | 3ms | 4324 KiB | ||||
22 | Accepted | 3ms | 4320 KiB | ||||
23 | Accepted | 3ms | 4204 KiB | ||||
24 | Accepted | 3ms | 4216 KiB | ||||
25 | Accepted | 3ms | 4312 KiB | ||||
26 | Accepted | 3ms | 4444 KiB |