結果

問題 No.2218 Multiple LIS
ユーザー 👑 KazunKazun
提出日時 2023-02-17 21:36:30
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 302 ms / 3,000 ms
コード長 429 bytes
コンパイル時間 271 ms
コンパイル使用メモリ 86,844 KB
実行使用メモリ 100,484 KB
最終ジャッジ日時 2023-09-26 18:47:52
合計ジャッジ時間 7,596 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 70 ms
71,284 KB
testcase_01 AC 68 ms
71,232 KB
testcase_02 AC 70 ms
71,056 KB
testcase_03 AC 71 ms
71,084 KB
testcase_04 AC 70 ms
71,004 KB
testcase_05 AC 69 ms
71,468 KB
testcase_06 AC 70 ms
71,228 KB
testcase_07 AC 69 ms
71,232 KB
testcase_08 AC 70 ms
71,208 KB
testcase_09 AC 71 ms
71,236 KB
testcase_10 AC 69 ms
71,376 KB
testcase_11 AC 72 ms
71,060 KB
testcase_12 AC 72 ms
75,184 KB
testcase_13 AC 76 ms
75,664 KB
testcase_14 AC 77 ms
75,512 KB
testcase_15 AC 76 ms
75,516 KB
testcase_16 AC 69 ms
71,216 KB
testcase_17 AC 77 ms
75,576 KB
testcase_18 AC 71 ms
71,180 KB
testcase_19 AC 70 ms
71,124 KB
testcase_20 AC 76 ms
75,364 KB
testcase_21 AC 214 ms
99,784 KB
testcase_22 AC 240 ms
99,116 KB
testcase_23 AC 233 ms
98,284 KB
testcase_24 AC 209 ms
99,060 KB
testcase_25 AC 243 ms
98,120 KB
testcase_26 AC 246 ms
97,444 KB
testcase_27 AC 247 ms
97,576 KB
testcase_28 AC 279 ms
97,580 KB
testcase_29 AC 283 ms
97,548 KB
testcase_30 AC 302 ms
100,484 KB
testcase_31 AC 169 ms
96,920 KB
testcase_32 AC 176 ms
97,060 KB
testcase_33 AC 183 ms
97,100 KB
testcase_34 AC 175 ms
96,920 KB
testcase_35 AC 167 ms
96,924 KB
testcase_36 AC 90 ms
88,680 KB
testcase_37 AC 248 ms
97,688 KB
testcase_38 AC 69 ms
71,112 KB
testcase_39 AC 71 ms
71,208 KB
testcase_40 AC 172 ms
97,076 KB
testcase_41 AC 176 ms
97,220 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def solve():
    N=int(input())
    A=list(map(int,input().split()))

    A_max=max(A)

    div=[[] for _ in range(A_max+1)]
    for a in range(1,A_max+1):
        for b in range(a,A_max+1,a):
            div[b].append(a)

    DP=[0]*(A_max+1)
    for a in A:
        x=0
        for b in div[a]:
            x=max(x, DP[b])
        DP[a]=x+1
    return max(DP)

#==================================================
print(solve())
0