<jupyter_start><jupyter_text>2020년 6월 25일 목요일 BaekJoon - 11054 : 가장 긴 바이토닉 부분 수열 (Python) 문제 : https://www.acmicpc.net/problem/11054 블로그 : https://somjang.tistory.com/entry/BaekJoon-11054%EB%B2%88-%EA%B0%80%EC%9E%A5-%EA%B8%B4-%EB%B0%94%EC%9D%B4%ED%86%A0%EB%8B%89-%EB%B6%80%EB%B6%84-%EC%88%98%EC%97%B4-Python  첫번째 시도<jupyter_code>import sys
r = lambda : sys.stdin.readline()

def _get_seq_len(a):
    dp = [1 for _ in range(len(a))]
    rev_dp = [1 for _ in range(len(a))]
    for i in range(len(a)):
        dp[i] = 1
        for j in range(i, -1, -1):
            if a[i] > a[j] and dp[i] <= dp[j]:
                dp[i] = dp[j] + 1
    for i in range(len(a)-1, -1, -1):
        rev_dp[i] = 1
        for j in range(i, len(a)):
            if a[i] > a[j] and rev_dp[i] <= rev_dp[j]:
                rev_dp[i] = rev_dp[j] + 1
    print(max([i+j for i,j in zip(dp, rev_dp)])-1)
    
N = int(r())
seq = list(map(int, r().split()))
_get_seq_len(seq)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.20081967213114754, 'fraction_numerical': 0.06967213114754098, 'mean_word_length': 2.831372549019608, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 2, 'lorem ipsum': 0, 'www.': 1, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '591878', 'license': 'MIT', 'n_tokens_mistral': 525, 'n_tokens_neox': 508, 'n_words': 89, 'path': 'DAY 101 ~ 200/DAY140_[BaekJoon] 가장 긴 바이토닉 부분 수열 (Python).ipynb', 'repo_name': 'SOMJANG/CODINGTEST_PRACTICE', 'size': '976'}