結果

問題 No.979 Longest Divisor Sequence
ユーザー kumatan400kumatan400
提出日時 2022-09-15 06:57:58
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 291 bytes
コンパイル時間 310 ms
コンパイル使用メモリ 87,212 KB
実行使用メモリ 190,040 KB
最終ジャッジ日時 2023-08-22 03:57:55
合計ジャッジ時間 18,956 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1,021 ms
170,948 KB
testcase_01 AC 1,020 ms
170,944 KB
testcase_02 AC 1,025 ms
171,228 KB
testcase_03 AC 1,004 ms
171,288 KB
testcase_04 WA -
testcase_05 AC 1,012 ms
171,176 KB
testcase_06 AC 1,002 ms
171,124 KB
testcase_07 AC 1,025 ms
170,960 KB
testcase_08 AC 1,022 ms
171,080 KB
testcase_09 AC 1,021 ms
171,088 KB
testcase_10 AC 1,027 ms
170,640 KB
testcase_11 AC 1,024 ms
170,880 KB
testcase_12 AC 1,038 ms
170,724 KB
testcase_13 WA -
testcase_14 AC 1,240 ms
190,040 KB
testcase_15 AC 1,119 ms
169,044 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
A = list(map(int, input().split()))
Z = 3 * 10**5

R = [[] for _ in range(Z+1)]
for i in range(1, Z+1):
    for j in range(i+i, Z+1, i):
        R[j].append(i)
R[1].append(1)


X = [0] * (Z+1)

for a in A:
    for r in R[a]:
        X[a] = max(X[a], X[r] + 1)

print(max(X))
0