結果

問題 No.2218 Multiple LIS
ユーザー stoqstoq
提出日時 2022-05-28 01:44:37
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 704 ms / 3,000 ms
コード長 348 bytes
コンパイル時間 267 ms
コンパイル使用メモリ 86,912 KB
実行使用メモリ 91,444 KB
最終ジャッジ日時 2023-09-14 16:40:16
合計ジャッジ時間 11,237 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 77 ms
75,724 KB
testcase_01 AC 72 ms
75,812 KB
testcase_02 AC 71 ms
75,708 KB
testcase_03 AC 74 ms
75,592 KB
testcase_04 AC 72 ms
75,592 KB
testcase_05 AC 73 ms
75,512 KB
testcase_06 AC 72 ms
75,872 KB
testcase_07 AC 72 ms
75,588 KB
testcase_08 AC 74 ms
75,816 KB
testcase_09 AC 73 ms
75,740 KB
testcase_10 AC 73 ms
75,804 KB
testcase_11 AC 73 ms
75,716 KB
testcase_12 AC 77 ms
76,656 KB
testcase_13 AC 81 ms
76,832 KB
testcase_14 AC 81 ms
76,688 KB
testcase_15 AC 79 ms
76,824 KB
testcase_16 AC 76 ms
76,664 KB
testcase_17 AC 79 ms
76,660 KB
testcase_18 AC 74 ms
75,796 KB
testcase_19 AC 75 ms
76,572 KB
testcase_20 AC 81 ms
76,792 KB
testcase_21 AC 106 ms
77,256 KB
testcase_22 AC 243 ms
81,072 KB
testcase_23 AC 349 ms
84,880 KB
testcase_24 AC 141 ms
77,428 KB
testcase_25 AC 379 ms
86,012 KB
testcase_26 AC 505 ms
90,940 KB
testcase_27 AC 508 ms
90,916 KB
testcase_28 AC 514 ms
91,224 KB
testcase_29 AC 506 ms
90,712 KB
testcase_30 AC 509 ms
90,988 KB
testcase_31 AC 209 ms
90,260 KB
testcase_32 AC 206 ms
90,352 KB
testcase_33 AC 208 ms
90,268 KB
testcase_34 AC 205 ms
90,252 KB
testcase_35 AC 205 ms
90,544 KB
testcase_36 AC 96 ms
89,708 KB
testcase_37 AC 704 ms
91,444 KB
testcase_38 AC 75 ms
75,736 KB
testcase_39 AC 77 ms
75,844 KB
testcase_40 AC 585 ms
91,184 KB
testcase_41 AC 581 ms
90,844 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
a = list(map(int, input().split()))
dp = [0] * 100010
for i in range(n):
    Max = 0
    d = 0
    while d * d <= a[i]:
        d += 1
        if a[i] % d != 0:
            continue
        if Max < dp[d]:
            Max = dp[d]
        if Max < dp[a[i] // d]:
            Max = dp[a[i] // d]
    dp[a[i]] = Max + 1
print(max(dp))
0