1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
n=int(input())
cnt = 0
nums=list(map(int, input().split()))
strat_min=nums[0]
strat_max=nums[0]
for i in range(1,n) :
if strat_min < nums[i] :
cnt+=1
strat_min=nums[i]
if strat_max > nums[i] :
cnt+=1
strat_max=nums[i]
print(cnt)
|
cs |
반응형
'python-algorithm' 카테고리의 다른 글
codeforces 1154A - Restoring Three Numbers (0) | 2022.04.29 |
---|---|
codeforces 486A - Calculating Function (0) | 2022.04.29 |
codeforces 977A - Wrong Subtraction (0) | 2022.04.29 |
codeforces 520A - Pangram (0) | 2022.04.29 |
codeforces 1328A - Divisibility Problem (0) | 2022.04.29 |
댓글