diff --git a/code_study/Baekjoon/python/12015.py b/code_study/Baekjoon/python/12015.py new file mode 100644 index 0000000..edc2390 --- /dev/null +++ b/code_study/Baekjoon/python/12015.py @@ -0,0 +1,22 @@ +N, A = int(input()), list(map(int, input().split())) + +LIS = [] + +for a in A : + if not len(LIS) or a > LIS[-1] : + LIS.append(a) + + else : + left, right = 0, len(LIS) - 1 + + while left < right : + mid = (left + right) // 2 + + if a > LIS[mid] : + left = mid + 1 + else : + right = mid + + LIS[left] = a + +print(len(LIS)) \ No newline at end of file diff --git a/code_study/Baekjoon/python/15015_1.py b/code_study/Baekjoon/python/15015_1.py new file mode 100644 index 0000000..30075ff --- /dev/null +++ b/code_study/Baekjoon/python/15015_1.py @@ -0,0 +1,15 @@ +from bisect import bisect_left + +N = int(input()) +A = list(map(int, input().split())) + +LIS = [] + +for a in A : + if not len(LIS) or a > LIS[-1]: + LIS.append(a) + else: + idx = bisect_left(LIS, a) + LIS[idx] = a + +print(len(LIS)) \ No newline at end of file diff --git a/code_study/Baekjoon/python/2914.py b/code_study/Baekjoon/python/2914.py new file mode 100644 index 0000000..af85e27 --- /dev/null +++ b/code_study/Baekjoon/python/2914.py @@ -0,0 +1 @@ +print((lambda A, I: A*(I-1)+1)(*list(map(int, input().split())))) \ No newline at end of file