結果

問題 No.2218 Multiple LIS
ユーザー roarisroaris
提出日時 2023-02-18 02:58:34
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 657 ms / 3,000 ms
コード長 348 bytes
コンパイル時間 278 ms
コンパイル使用メモリ 87,048 KB
実行使用メモリ 93,920 KB
最終ジャッジ日時 2023-09-26 23:24:58
合計ジャッジ時間 11,022 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 75 ms
76,524 KB
testcase_01 AC 74 ms
75,824 KB
testcase_02 AC 77 ms
76,176 KB
testcase_03 AC 74 ms
75,980 KB
testcase_04 AC 73 ms
76,172 KB
testcase_05 AC 74 ms
76,340 KB
testcase_06 AC 75 ms
76,036 KB
testcase_07 AC 75 ms
76,372 KB
testcase_08 AC 75 ms
76,152 KB
testcase_09 AC 76 ms
76,400 KB
testcase_10 AC 75 ms
76,340 KB
testcase_11 AC 74 ms
76,560 KB
testcase_12 AC 79 ms
77,548 KB
testcase_13 AC 83 ms
77,884 KB
testcase_14 AC 83 ms
77,904 KB
testcase_15 AC 83 ms
77,824 KB
testcase_16 AC 77 ms
77,032 KB
testcase_17 AC 85 ms
77,952 KB
testcase_18 AC 76 ms
76,172 KB
testcase_19 AC 79 ms
77,288 KB
testcase_20 AC 85 ms
77,924 KB
testcase_21 AC 109 ms
78,088 KB
testcase_22 AC 238 ms
81,540 KB
testcase_23 AC 347 ms
85,404 KB
testcase_24 AC 140 ms
77,932 KB
testcase_25 AC 374 ms
86,344 KB
testcase_26 AC 504 ms
91,576 KB
testcase_27 AC 502 ms
91,396 KB
testcase_28 AC 510 ms
91,396 KB
testcase_29 AC 499 ms
91,388 KB
testcase_30 AC 506 ms
91,428 KB
testcase_31 AC 218 ms
90,916 KB
testcase_32 AC 220 ms
90,804 KB
testcase_33 AC 221 ms
90,796 KB
testcase_34 AC 220 ms
91,212 KB
testcase_35 AC 234 ms
91,024 KB
testcase_36 AC 94 ms
89,848 KB
testcase_37 AC 606 ms
93,920 KB
testcase_38 AC 76 ms
76,380 KB
testcase_39 AC 76 ms
76,244 KB
testcase_40 AC 656 ms
91,500 KB
testcase_41 AC 657 ms
91,580 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = sys.stdin.readline

N = int(input())
A = list(map(int, input().split()))
dp = [0]*(10**5+10)

for Ai in A:
    if Ai==1:
        dp[Ai] += 1
    else:
        for d in range(1, int(Ai**0.5)+1):
            if Ai%d==0:
                dp[Ai] = max(dp[Ai], dp[Ai//d]+1)
                dp[Ai] = max(dp[Ai], dp[d]+1)

print(max(dp))
0