Created
March 24, 2026 08:54
-
-
Save maehrm/4d70dc4f5eed8a3312c2dc938572e68d to your computer and use it in GitHub Desktop.
E - Sequence Decomposing https://atcoder.jp/contests/abc134/tasks/abc134_e
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 bisect | |
| N = int(input()) | |
| A = [int(input()) for _ in range(N)][::-1] | |
| lis = [] | |
| for i in range(N): | |
| idx = bisect.bisect_right(lis, A[i]) | |
| if idx == len(lis): | |
| lis.append(A[i]) | |
| else: | |
| lis[idx] = A[i] | |
| print(len(lis)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment