結果

問題 No.2218 Multiple LIS
ユーザー tassei903tassei903
提出日時 2023-02-17 21:45:34
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 358 ms / 3,000 ms
コード長 670 bytes
コンパイル時間 423 ms
コンパイル使用メモリ 87,008 KB
実行使用メモリ 101,276 KB
最終ジャッジ日時 2023-09-26 19:00:07
合計ジャッジ時間 13,332 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 235 ms
90,516 KB
testcase_01 AC 226 ms
90,628 KB
testcase_02 AC 229 ms
90,484 KB
testcase_03 AC 226 ms
90,316 KB
testcase_04 AC 230 ms
90,476 KB
testcase_05 AC 224 ms
90,560 KB
testcase_06 AC 220 ms
90,480 KB
testcase_07 AC 220 ms
90,600 KB
testcase_08 AC 231 ms
90,432 KB
testcase_09 AC 235 ms
90,312 KB
testcase_10 AC 251 ms
90,308 KB
testcase_11 AC 246 ms
90,668 KB
testcase_12 AC 264 ms
100,884 KB
testcase_13 AC 265 ms
101,276 KB
testcase_14 AC 263 ms
100,944 KB
testcase_15 AC 254 ms
100,984 KB
testcase_16 AC 239 ms
90,540 KB
testcase_17 AC 249 ms
100,984 KB
testcase_18 AC 234 ms
90,436 KB
testcase_19 AC 228 ms
90,508 KB
testcase_20 AC 252 ms
100,868 KB
testcase_21 AC 267 ms
100,324 KB
testcase_22 AC 273 ms
99,768 KB
testcase_23 AC 312 ms
99,092 KB
testcase_24 AC 270 ms
99,992 KB
testcase_25 AC 311 ms
98,760 KB
testcase_26 AC 358 ms
98,148 KB
testcase_27 AC 325 ms
98,060 KB
testcase_28 AC 324 ms
98,164 KB
testcase_29 AC 318 ms
97,984 KB
testcase_30 AC 291 ms
98,076 KB
testcase_31 AC 255 ms
98,564 KB
testcase_32 AC 261 ms
98,460 KB
testcase_33 AC 281 ms
98,640 KB
testcase_34 AC 298 ms
98,556 KB
testcase_35 AC 275 ms
98,480 KB
testcase_36 AC 257 ms
98,836 KB
testcase_37 AC 286 ms
97,764 KB
testcase_38 AC 230 ms
90,316 KB
testcase_39 AC 228 ms
90,692 KB
testcase_40 AC 262 ms
97,756 KB
testcase_41 AC 267 ms
97,848 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = lambda :sys.stdin.readline()[:-1]
ni = lambda :int(input())
na = lambda :list(map(int,input().split()))
yes = lambda :print("yes");Yes = lambda :print("Yes");YES = lambda : print("YES")
no = lambda :print("no");No = lambda :print("No");NO = lambda : print("NO")
#######################################################################
n = ni()
a = na()
m = 10**5+1
b = [[] for i in range(m)]

for i in range(1, m):
    for j in range(i*2, m, i):
        b[j].append(i)


dp = [0] * m
for i in range(n):
    x = dp[a[i]]
    for j in b[a[i]]:
        dp[a[i]] = max(dp[a[i]], dp[j] + 1)
    dp[a[i]] = max(dp[a[i]], x + 1)
    #print(dp)
print(max(dp))
0