結果

問題 No.2218 Multiple LIS
ユーザー ああいいああいい
提出日時 2023-02-18 18:03:24
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 322 ms / 3,000 ms
コード長 395 bytes
コンパイル時間 311 ms
コンパイル使用メモリ 87,024 KB
実行使用メモリ 106,504 KB
最終ジャッジ日時 2023-09-27 08:57:33
合計ジャッジ時間 11,530 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 183 ms
99,696 KB
testcase_01 AC 176 ms
99,728 KB
testcase_02 AC 174 ms
99,708 KB
testcase_03 AC 176 ms
99,720 KB
testcase_04 AC 180 ms
99,756 KB
testcase_05 AC 173 ms
99,596 KB
testcase_06 AC 182 ms
99,568 KB
testcase_07 AC 182 ms
99,620 KB
testcase_08 AC 186 ms
99,736 KB
testcase_09 AC 184 ms
99,616 KB
testcase_10 AC 175 ms
99,732 KB
testcase_11 AC 180 ms
99,844 KB
testcase_12 AC 180 ms
99,888 KB
testcase_13 AC 188 ms
99,648 KB
testcase_14 AC 180 ms
99,832 KB
testcase_15 AC 185 ms
99,796 KB
testcase_16 AC 184 ms
99,464 KB
testcase_17 AC 182 ms
99,672 KB
testcase_18 AC 186 ms
99,424 KB
testcase_19 AC 178 ms
99,700 KB
testcase_20 AC 179 ms
99,732 KB
testcase_21 AC 232 ms
99,888 KB
testcase_22 AC 223 ms
102,324 KB
testcase_23 AC 261 ms
105,168 KB
testcase_24 AC 202 ms
99,876 KB
testcase_25 AC 269 ms
105,004 KB
testcase_26 AC 308 ms
106,360 KB
testcase_27 AC 298 ms
106,256 KB
testcase_28 AC 304 ms
106,284 KB
testcase_29 AC 322 ms
106,480 KB
testcase_30 AC 311 ms
106,504 KB
testcase_31 AC 236 ms
98,068 KB
testcase_32 AC 237 ms
97,960 KB
testcase_33 AC 235 ms
98,076 KB
testcase_34 AC 237 ms
98,112 KB
testcase_35 AC 238 ms
98,048 KB
testcase_36 AC 196 ms
98,396 KB
testcase_37 AC 233 ms
98,176 KB
testcase_38 AC 181 ms
99,636 KB
testcase_39 AC 190 ms
99,668 KB
testcase_40 AC 244 ms
98,024 KB
testcase_41 AC 261 ms
98,220 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
A = list(map(int,input().split()))

C = 10 ** 5 + 5
div = [[1] for _ in range(C)]
div[1] = []
for i in range(2,C):
    for j in range(i + i,C,i):
        div[j].append(i)
d = dict()
d[1] = 0
for a in A:
    if a not in d:
        d[a] = 0
    else:
        d[a] += 1
    for u in div[a]:
        if u in d:
            d[a] = max(d[a],d[u] + 1)
print(max(d.values()))
#print(d)
0