Created
December 18, 2019 06:28
-
-
Save inspirit941/426ae62e7f2da7460f957855f27c8812 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
N = int(sys.stdin.readline()) | |
arr = list(map(int, sys.stdin.readline().split())) | |
result = [1] * N | |
for i in range(1, N): | |
for j in range(i): | |
if arr[j] < arr[i]: | |
result[i] = max(result[i], result[j]+1) | |
print(max(result)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment