結果
問題 |
No.390 最長の数列
|
ユーザー |
|
提出日時 | 2016-10-15 09:57:59 |
言語 | Python2 (2.7.18) |
結果 |
WA
|
実行時間 | - |
コード長 | 253 bytes |
コンパイル時間 | 254 ms |
コンパイル使用メモリ | 6,944 KB |
実行使用メモリ | 41,324 KB |
最終ジャッジ日時 | 2024-11-22 11:19:36 |
合計ジャッジ時間 | 12,400 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 WA * 1 |
other | AC * 12 WA * 3 |
ソースコード
N = input() x = sorted(map(int, raw_input().split())) m = max(x) dp = [float('-inf') for _ in xrange(m+1)] for a in x: dp[a] = 1 for a in x: b = a*2 c = dp[a] while b <= m: dp[b] = max(c+1, dp[b]) b += a print max(dp)