6057 | 2023-10-29 02:27:18 | CZH | Szomjas állatok | cpp17 | Accepted 100/100 | 3ms | 4800 KiB |
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <cmath>
#include <iomanip>
using ll = long long;
using namespace std;
int main()
{
int n;
cin >> n;
vector<int> allAnimal = {};
for (int i = 0; i < n; i++)
{
int tmp;
cin >> tmp;
allAnimal.push_back(tmp);
}
int max = 0;
int mxNum = 0;
for (int i = n - 1; i >= 0; i--)
{
if (allAnimal[i] >= max)
{
max = allAnimal[i];
mxNum++;
}
}
cout << mxNum;
}
Subtask | Sum | Test | Verdict | Time | Memory | ||
---|---|---|---|---|---|---|---|
subtask1 | 0/0 | ||||||
1 | Accepted | 3ms | 1812 KiB | ||||
2 | Accepted | 3ms | 2052 KiB | ||||
subtask2 | 5/5 | ||||||
3 | Accepted | 3ms | 2268 KiB | ||||
4 | Accepted | 3ms | 2476 KiB | ||||
5 | Accepted | 2ms | 2564 KiB | ||||
subtask3 | 20/20 | ||||||
6 | Accepted | 2ms | 2568 KiB | ||||
7 | Accepted | 3ms | 2808 KiB | ||||
8 | Accepted | 3ms | 2940 KiB | ||||
9 | Accepted | 3ms | 2972 KiB | ||||
10 | Accepted | 3ms | 3060 KiB | ||||
subtask4 | 25/25 | ||||||
11 | Accepted | 3ms | 3244 KiB | ||||
12 | Accepted | 3ms | 3456 KiB | ||||
13 | Accepted | 3ms | 3512 KiB | ||||
14 | Accepted | 3ms | 3644 KiB | ||||
15 | Accepted | 3ms | 3892 KiB | ||||
subtask5 | 20/20 | ||||||
16 | Accepted | 2ms | 3980 KiB | ||||
17 | Accepted | 3ms | 3980 KiB | ||||
18 | Accepted | 3ms | 3992 KiB | ||||
19 | Accepted | 3ms | 4124 KiB | ||||
20 | Accepted | 3ms | 4344 KiB | ||||
subtask6 | 30/30 | ||||||
21 | Accepted | 3ms | 4536 KiB | ||||
22 | Accepted | 3ms | 4656 KiB | ||||
23 | Accepted | 3ms | 4800 KiB | ||||
24 | Accepted | 3ms | 4664 KiB | ||||
25 | Accepted | 3ms | 4772 KiB | ||||
26 | Accepted | 3ms | 4772 KiB |