Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # escadinha
- # fase 1
- # obi 2018
- # python
- # by Deukaus / Matheus Santos
- # https://olimpiada.ic.unicamp.br/pratique/p1/2018/f1/escadinha/
- size = int(input())
- esc = 1
- if size < 1:
- esc = 0
- n = input().split(" ")
- n = list(map(int, n))
- dif = 0
- if size == 1:
- print(1)
- else:
- for nums in range(1,size):
- dif2 = n[nums] - n[nums-1]
- if dif2 != dif:
- dif = n[nums] - n[nums - 1]
- esc += 1
- print(esc)
Advertisement
Add Comment
Please, Sign In to add comment