結果
| 問題 | No.390 最長の数列 | 
| コンテスト | |
| ユーザー |  | 
| 提出日時 | 2020-09-15 19:50:27 | 
| 言語 | PyPy3 (7.3.15) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 187 ms / 5,000 ms | 
| コード長 | 195 bytes | 
| コンパイル時間 | 322 ms | 
| コンパイル使用メモリ | 82,404 KB | 
| 実行使用メモリ | 114,052 KB | 
| 最終ジャッジ日時 | 2024-06-22 01:54:26 | 
| 合計ジャッジ時間 | 2,895 ms | 
| ジャッジサーバーID (参考情報) | judge3 / judge2 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 4 | 
| other | AC * 15 | 
ソースコード
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))
            
            
            
        