generated from projeto-de-algoritmos/RepositorioTemplate
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
29 lines (21 loc) · 764 Bytes
/
main.py
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
def main():
try:
while True:
n = int(input())
input_lst = list(map(float, input().split(" ")))
temp_lst = [0 for _ in range(n)]
predecessores = [n for n in range(n)]
for index, item in enumerate(input_lst):
temp_lst[index] = 1
predecessores[index] = 0
for j in range(index):
if input_lst[j] < input_lst[index] and ((1 + temp_lst[j]) > temp_lst[index]):
temp_lst[index] = 1 + temp_lst[j]
predecessores[index] = j
big = max(temp_lst)
print(big)
except EOFError:
return 0
return 0
if __name__ == "__main__":
main()