結果

問題 No.979 Longest Divisor Sequence
ユーザー kumatan400kumatan400
提出日時 2021-12-24 06:48:09
言語 PyPy3
(7.3.15)
結果
RE  
実行時間 -
コード長 303 bytes
コンパイル時間 167 ms
コンパイル使用メモリ 81,684 KB
実行使用メモリ 121,088 KB
最終ジャッジ日時 2023-10-19 07:17:20
合計ジャッジ時間 2,108 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 39 ms
53,228 KB
testcase_01 RE -
testcase_02 AC 40 ms
53,228 KB
testcase_03 RE -
testcase_04 AC 39 ms
53,228 KB
testcase_05 RE -
testcase_06 RE -
testcase_07 RE -
testcase_08 RE -
testcase_09 RE -
testcase_10 RE -
testcase_11 RE -
testcase_12 RE -
testcase_13 AC 139 ms
121,088 KB
testcase_14 RE -
testcase_15 RE -
権限があれば一括ダウンロードができます

ソースコード

diff #

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

Z = 3 * 10**5
Z = 10
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(0)


L = [0] * (Z+1)
for a in A:
    M = max(L[r] for r in R[a])
    L[a] = M + 1


ans = max(L)
print(ans)
0