結果

問題 No.1188 レベルX門松列
ユーザー marroncastlemarroncastle
提出日時 2020-08-22 19:49:23
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 569 bytes
コンパイル時間 653 ms
コンパイル使用メモリ 82,516 KB
実行使用メモリ 91,008 KB
最終ジャッジ日時 2024-04-23 12:18:26
合計ジャッジ時間 4,149 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 179 ms
88,832 KB
testcase_02 WA -
testcase_03 WA -
testcase_04 AC 193 ms
90,496 KB
testcase_05 AC 42 ms
52,224 KB
testcase_06 WA -
testcase_07 AC 176 ms
90,092 KB
testcase_08 AC 182 ms
89,984 KB
testcase_09 AC 44 ms
51,968 KB
testcase_10 WA -
testcase_11 WA -
testcase_12 AC 95 ms
76,360 KB
testcase_13 AC 94 ms
76,416 KB
testcase_14 WA -
testcase_15 AC 198 ms
91,008 KB
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 AC 42 ms
52,096 KB
testcase_21 AC 43 ms
52,352 KB
testcase_22 AC 41 ms
52,096 KB
testcase_23 AC 41 ms
52,352 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from bisect import bisect_left
N = int(input())
A = list(map(int, input().split()))
def LIS(A,N):
    lis = []
    ans = [0]*N
    for i in range(N):
        ans[i] = len(lis)
        ind = bisect_left(lis,A[i])
        if ind == len(lis):
            lis.append(A[i])
        else:
            lis[ind] = A[i]
    return ans
def kadomatsu(A,N):
    lis1 = LIS(A,N)
    lis2 = LIS(A[::-1],N)[::-1]
    ans = 0
    for i in range(N):
        ans = max(ans, min(lis1[i],lis2[i]))
    return ans
a = kadomatsu(A,N)
b = kadomatsu(list(map(lambda x:-x,A)),N)
print(max(a,b))
0