結果

問題 No.390 最長の数列
ユーザー mlihua09mlihua09
提出日時 2020-09-15 19:50:27
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 227 ms / 5,000 ms
コード長 195 bytes
コンパイル時間 258 ms
コンパイル使用メモリ 87,292 KB
実行使用メモリ 108,344 KB
最終ジャッジ日時 2023-09-04 01:54:19
合計ジャッジ時間 3,746 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 71 ms
70,916 KB
testcase_01 AC 74 ms
71,332 KB
testcase_02 AC 74 ms
75,012 KB
testcase_03 AC 74 ms
71,140 KB
testcase_04 AC 72 ms
71,432 KB
testcase_05 AC 177 ms
98,924 KB
testcase_06 AC 227 ms
108,344 KB
testcase_07 AC 72 ms
71,408 KB
testcase_08 AC 79 ms
82,964 KB
testcase_09 AC 86 ms
91,112 KB
testcase_10 AC 153 ms
99,012 KB
testcase_11 AC 154 ms
99,012 KB
testcase_12 AC 153 ms
99,252 KB
testcase_13 AC 141 ms
97,096 KB
testcase_14 AC 144 ms
91,784 KB
testcase_15 AC 74 ms
75,284 KB
testcase_16 AC 78 ms
82,728 KB
testcase_17 AC 89 ms
84,172 KB
testcase_18 AC 90 ms
84,252 KB
権限があれば一括ダウンロードができます

ソースコード

diff #


N = int(input())

X = list(map(int, input().split()))
X.sort(reverse=True)
M = max(X)
dp = [0] * (M + 1)
for x in X:
    dp[x] = max([dp[i] + 1 for i in range(x, M + 1, x)])
    
print(max(dp))
0