6434 | 2023-11-29 11:10:52 | MCDave | Szomjas állatok | cpp17 | Accepted 100/100 | 3ms | 4712 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();
}
Subtask | Sum | Test | Verdict | Time | Memory | ||
---|---|---|---|---|---|---|---|
subtask1 | 0/0 | ||||||
1 | Accepted | 3ms | 1960 KiB | ||||
2 | Accepted | 3ms | 2016 KiB | ||||
subtask2 | 5/5 | ||||||
3 | Accepted | 3ms | 2208 KiB | ||||
4 | Accepted | 3ms | 2460 KiB | ||||
5 | Accepted | 3ms | 2616 KiB | ||||
subtask3 | 20/20 | ||||||
6 | Accepted | 3ms | 2752 KiB | ||||
7 | Accepted | 3ms | 2944 KiB | ||||
8 | Accepted | 3ms | 3192 KiB | ||||
9 | Accepted | 3ms | 3252 KiB | ||||
10 | Accepted | 3ms | 3240 KiB | ||||
subtask4 | 25/25 | ||||||
11 | Accepted | 3ms | 3372 KiB | ||||
12 | Accepted | 3ms | 3456 KiB | ||||
13 | Accepted | 3ms | 3580 KiB | ||||
14 | Accepted | 3ms | 3796 KiB | ||||
15 | Accepted | 3ms | 4040 KiB | ||||
subtask5 | 20/20 | ||||||
16 | Accepted | 3ms | 4092 KiB | ||||
17 | Accepted | 3ms | 4204 KiB | ||||
18 | Accepted | 3ms | 4456 KiB | ||||
19 | Accepted | 3ms | 4544 KiB | ||||
20 | Accepted | 3ms | 4548 KiB | ||||
subtask6 | 30/30 | ||||||
21 | Accepted | 3ms | 4476 KiB | ||||
22 | Accepted | 3ms | 4588 KiB | ||||
23 | Accepted | 3ms | 4708 KiB | ||||
24 | Accepted | 3ms | 4712 KiB | ||||
25 | Accepted | 3ms | 4696 KiB | ||||
26 | Accepted | 3ms | 4592 KiB |