結果

問題 No.2218 Multiple LIS
ユーザー shakayamishakayami
提出日時 2023-02-17 21:57:58
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 451 bytes
コンパイル時間 287 ms
コンパイル使用メモリ 86,992 KB
実行使用メモリ 108,020 KB
最終ジャッジ日時 2023-09-26 19:15:24
合計ジャッジ時間 10,478 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 72 ms
70,896 KB
testcase_01 AC 70 ms
71,120 KB
testcase_02 AC 70 ms
71,228 KB
testcase_03 AC 70 ms
71,228 KB
testcase_04 AC 70 ms
70,936 KB
testcase_05 AC 70 ms
71,068 KB
testcase_06 AC 71 ms
71,188 KB
testcase_07 AC 70 ms
70,760 KB
testcase_08 AC 71 ms
70,932 KB
testcase_09 AC 69 ms
71,164 KB
testcase_10 AC 68 ms
71,012 KB
testcase_11 AC 70 ms
71,064 KB
testcase_12 AC 90 ms
75,672 KB
testcase_13 AC 82 ms
76,136 KB
testcase_14 AC 83 ms
75,940 KB
testcase_15 AC 84 ms
76,192 KB
testcase_16 AC 72 ms
70,904 KB
testcase_17 AC 83 ms
76,056 KB
testcase_18 AC 71 ms
70,932 KB
testcase_19 AC 71 ms
71,156 KB
testcase_20 AC 79 ms
75,928 KB
testcase_21 AC 215 ms
100,248 KB
testcase_22 AC 249 ms
99,992 KB
testcase_23 AC 276 ms
99,976 KB
testcase_24 AC 231 ms
99,936 KB
testcase_25 AC 292 ms
99,652 KB
testcase_26 AC 361 ms
107,332 KB
testcase_27 AC 355 ms
107,256 KB
testcase_28 AC 350 ms
107,604 KB
testcase_29 AC 361 ms
108,020 KB
testcase_30 AC 372 ms
107,740 KB
testcase_31 TLE -
testcase_32 -- -
testcase_33 -- -
testcase_34 -- -
testcase_35 -- -
testcase_36 -- -
testcase_37 -- -
testcase_38 -- -
testcase_39 -- -
testcase_40 -- -
testcase_41 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

N=int(input())
A=[int(i) for i in input().split()]
maxA=max(A)
div=[[] for i in range(maxA+1)]
for i in range(1,maxA+1):
    for j in range(i,maxA+1,i):
        div[j].append(i)
B=[[] for i in range(maxA+1)]
dp=[0 for i in range(N)]
for i in range(N):
    #dp[i] i番目が最後であるような列のmax
    dp[i]=max(dp[i],1)
    for d in div[A[i]]:
        for j in B[d]:
            dp[i]=max(dp[i],dp[j]+1)
    B[A[i]].append(i)
print(max(dp))
0