結果

問題 No.2218 Multiple LIS
ユーザー rlangevinrlangevin
提出日時 2023-02-17 21:49:48
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 878 ms / 3,000 ms
コード長 420 bytes
コンパイル時間 1,067 ms
コンパイル使用メモリ 86,692 KB
実行使用メモリ 96,064 KB
最終ジャッジ日時 2023-09-26 19:07:25
合計ジャッジ時間 13,335 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 98 ms
76,636 KB
testcase_01 AC 98 ms
76,792 KB
testcase_02 AC 98 ms
76,868 KB
testcase_03 AC 99 ms
77,088 KB
testcase_04 AC 99 ms
76,900 KB
testcase_05 AC 100 ms
76,844 KB
testcase_06 AC 100 ms
76,868 KB
testcase_07 AC 99 ms
76,796 KB
testcase_08 AC 97 ms
76,856 KB
testcase_09 AC 97 ms
76,924 KB
testcase_10 AC 100 ms
76,984 KB
testcase_11 AC 99 ms
76,876 KB
testcase_12 AC 111 ms
77,656 KB
testcase_13 AC 111 ms
78,016 KB
testcase_14 AC 111 ms
78,224 KB
testcase_15 AC 108 ms
78,320 KB
testcase_16 AC 102 ms
77,384 KB
testcase_17 AC 111 ms
78,112 KB
testcase_18 AC 102 ms
76,612 KB
testcase_19 AC 101 ms
77,056 KB
testcase_20 AC 112 ms
78,044 KB
testcase_21 AC 138 ms
78,264 KB
testcase_22 AC 281 ms
83,012 KB
testcase_23 AC 394 ms
85,792 KB
testcase_24 AC 172 ms
78,880 KB
testcase_25 AC 440 ms
86,864 KB
testcase_26 AC 576 ms
91,720 KB
testcase_27 AC 578 ms
91,656 KB
testcase_28 AC 572 ms
91,648 KB
testcase_29 AC 567 ms
91,660 KB
testcase_30 AC 572 ms
91,832 KB
testcase_31 AC 273 ms
91,272 KB
testcase_32 AC 286 ms
91,692 KB
testcase_33 AC 275 ms
91,224 KB
testcase_34 AC 273 ms
91,192 KB
testcase_35 AC 287 ms
91,096 KB
testcase_36 AC 146 ms
93,512 KB
testcase_37 AC 878 ms
96,064 KB
testcase_38 AC 100 ms
76,908 KB
testcase_39 AC 101 ms
76,876 KB
testcase_40 AC 715 ms
91,704 KB
testcase_41 AC 720 ms
91,700 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import *

def div(n):
    if n <= 0:
        return []
    S = set()
    i = 1
    while i * i <= n:
        if n % i == 0:
            S.add(i)
            S.add(n // i)
        i += 1
    return sorted(list(S), reverse=True)

N = int(input())
A = list(map(int, input().split()))
dp = [-10] * 101010
dp[1] = 0
for a in A:
    for d in div(a):
        dp[a] = max(dp[a], dp[d] + 1) 
    
print(max(dp))
0