-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path440_Everest.cpp
46 lines (42 loc) · 991 Bytes
/
440_Everest.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
// Usuario de Acepta el reto: jjjjjjjp022
#include <iostream>
#include <vector>
using namespace std;
int main()
{
int casos;
cin >> casos;
while (casos != 0)
{
//vector <int> v (casos);
long long int tmp, min, max, tamAct, grupos = 1, minTmp;
cin >> minTmp;
max = 1;
min = casos;
tamAct = 1;
for (int i = 1; i < casos; i++)
{
cin >> tmp;
if (tmp < minTmp)
{
minTmp = tmp;
if (tamAct > max)
max = tamAct;
if (tamAct < min)
min = tamAct;
tamAct = 1;
grupos++;
}
else
{
tamAct++;
}
}
if (tamAct > max)
max = tamAct;
else if (tamAct < min)
min = tamAct;
cout << grupos << " " << min << " " << max << endl;
cin >> casos;
}
}