6335 | 2023-11-20 10:55:29 | Ghost | Szomjas állatok | cpp17 | Accepted 100/100 | 6ms | 4332 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;
}
Subtask | Sum | Test | Verdict | Time | Memory | ||
---|---|---|---|---|---|---|---|
subtask1 | 0/0 | ||||||
1 | Accepted | 3ms | 1812 KiB | ||||
2 | Accepted | 3ms | 2060 KiB | ||||
subtask2 | 5/5 | ||||||
3 | Accepted | 3ms | 2312 KiB | ||||
4 | Accepted | 3ms | 2524 KiB | ||||
5 | Accepted | 3ms | 2728 KiB | ||||
subtask3 | 20/20 | ||||||
6 | Accepted | 3ms | 2944 KiB | ||||
7 | Accepted | 3ms | 3156 KiB | ||||
8 | Accepted | 3ms | 3244 KiB | ||||
9 | Accepted | 4ms | 3180 KiB | ||||
10 | Accepted | 6ms | 3264 KiB | ||||
subtask4 | 25/25 | ||||||
11 | Accepted | 3ms | 3504 KiB | ||||
12 | Accepted | 3ms | 3476 KiB | ||||
13 | Accepted | 3ms | 3480 KiB | ||||
14 | Accepted | 2ms | 3592 KiB | ||||
15 | Accepted | 3ms | 3584 KiB | ||||
subtask5 | 20/20 | ||||||
16 | Accepted | 3ms | 3600 KiB | ||||
17 | Accepted | 3ms | 3840 KiB | ||||
18 | Accepted | 4ms | 3912 KiB | ||||
19 | Accepted | 4ms | 3916 KiB | ||||
20 | Accepted | 3ms | 3916 KiB | ||||
subtask6 | 30/30 | ||||||
21 | Accepted | 2ms | 3912 KiB | ||||
22 | Accepted | 3ms | 4028 KiB | ||||
23 | Accepted | 3ms | 4156 KiB | ||||
24 | Accepted | 4ms | 4212 KiB | ||||
25 | Accepted | 4ms | 4332 KiB | ||||
26 | Accepted | 3ms | 4220 KiB |