2674 | 2023-01-18 20:59:48 | Ancsa | Szomjas állatok | cpp11 | Accepted 100/100 | 72ms | 5088 KiB |
#include <bits/stdc++.h>
using namespace std;
int main()
{
int n;
cin>>n;
vector<int> meret(100001);
int uj;
for(int i=0;i<n;i++)
{
cin>>uj;
meret.at(uj)++;
for(int j=1;j<uj;j++)
meret.at(j)=0;
}
int osszes=0;
for(int i=0;i<100001;i++)
osszes+=meret.at(i);
cout <<osszes << endl;
return 0;
}
Subtask | Sum | Test | Verdict | Time | Memory | ||
---|---|---|---|---|---|---|---|
subtask1 | 0/0 | ||||||
1 | Accepted | 3ms | 2392 KiB | ||||
2 | Accepted | 2ms | 2556 KiB | ||||
subtask2 | 5/5 | ||||||
3 | Accepted | 2ms | 2760 KiB | ||||
4 | Accepted | 3ms | 2964 KiB | ||||
5 | Accepted | 2ms | 3036 KiB | ||||
subtask3 | 20/20 | ||||||
6 | Accepted | 3ms | 3264 KiB | ||||
7 | Accepted | 3ms | 3468 KiB | ||||
8 | Accepted | 2ms | 3444 KiB | ||||
9 | Accepted | 3ms | 3676 KiB | ||||
10 | Accepted | 3ms | 3860 KiB | ||||
subtask4 | 25/25 | ||||||
11 | Accepted | 3ms | 4060 KiB | ||||
12 | Accepted | 2ms | 4168 KiB | ||||
13 | Accepted | 2ms | 4368 KiB | ||||
14 | Accepted | 2ms | 4448 KiB | ||||
15 | Accepted | 8ms | 4448 KiB | ||||
subtask5 | 20/20 | ||||||
16 | Accepted | 2ms | 4444 KiB | ||||
17 | Accepted | 2ms | 4452 KiB | ||||
18 | Accepted | 3ms | 4444 KiB | ||||
19 | Accepted | 9ms | 4548 KiB | ||||
20 | Accepted | 71ms | 4676 KiB | ||||
subtask6 | 30/30 | ||||||
21 | Accepted | 8ms | 5028 KiB | ||||
22 | Accepted | 17ms | 4772 KiB | ||||
23 | Accepted | 37ms | 5000 KiB | ||||
24 | Accepted | 57ms | 4992 KiB | ||||
25 | Accepted | 72ms | 5088 KiB | ||||
26 | Accepted | 64ms | 4976 KiB |