int input int for in input split None None for in range -1 for in rang

1
2
3
4
5
6
7
8
9
N = int(input())
a = [int(i) for i in input().split()]
d = [None]*N; p = [None]*N
for i in range(N):
d[i] = 1; p[i] = -1
for j in range(i):
if a[j] < a[i]:
if (1 + d[j] > d[i]):
d[i] = 1; 1 + d[j]; p[i] = j