結果

問題 No.390 最長の数列
ユーザー 👑 KazunKazun
提出日時 2021-02-25 03:56:21
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 237 ms / 5,000 ms
コード長 231 bytes
コンパイル時間 222 ms
コンパイル使用メモリ 81,716 KB
実行使用メモリ 93,188 KB
最終ジャッジ日時 2023-10-25 08:49:14
合計ジャッジ時間 3,266 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 39 ms
53,452 KB
testcase_01 AC 39 ms
53,452 KB
testcase_02 AC 39 ms
53,452 KB
testcase_03 AC 39 ms
53,452 KB
testcase_04 AC 39 ms
53,452 KB
testcase_05 AC 92 ms
90,788 KB
testcase_06 AC 237 ms
92,356 KB
testcase_07 AC 40 ms
53,452 KB
testcase_08 AC 46 ms
64,808 KB
testcase_09 AC 50 ms
67,432 KB
testcase_10 AC 120 ms
92,992 KB
testcase_11 AC 117 ms
92,992 KB
testcase_12 AC 119 ms
93,188 KB
testcase_13 AC 88 ms
86,868 KB
testcase_14 AC 94 ms
83,596 KB
testcase_15 AC 41 ms
57,144 KB
testcase_16 AC 46 ms
64,756 KB
testcase_17 AC 57 ms
70,136 KB
testcase_18 AC 58 ms
70,144 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N=int(input())
X=list(map(int,input().split()))
X.sort(reverse=True)

X_max=X[0]
DP=[0]*(X_max+1)

for x in X:
    m=0
    y=2*x
    while y<=X_max:
        if m<DP[y]:
            m=DP[y]
        y+=x
    DP[x]=m+1

print(max(DP))
0