結果

問題 No.390 最長の数列
ユーザー nebukuro09nebukuro09
提出日時 2016-10-15 09:57:59
言語 Python2
(2.7.18)
結果
WA  
実行時間 -
コード長 253 bytes
コンパイル時間 67 ms
コンパイル使用メモリ 7,040 KB
実行使用メモリ 41,456 KB
最終ジャッジ日時 2024-05-02 01:52:40
合計ジャッジ時間 11,194 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 11 ms
6,272 KB
testcase_01 AC 11 ms
6,400 KB
testcase_02 AC 10 ms
6,400 KB
testcase_03 WA -
testcase_04 AC 11 ms
6,400 KB
testcase_05 AC 367 ms
41,452 KB
testcase_06 AC 3,384 ms
41,432 KB
testcase_07 AC 11 ms
6,272 KB
testcase_08 AC 254 ms
38,016 KB
testcase_09 AC 583 ms
38,016 KB
testcase_10 WA -
testcase_11 AC 895 ms
41,456 KB
testcase_12 WA -
testcase_13 WA -
testcase_14 AC 502 ms
14,800 KB
testcase_15 AC 15 ms
6,912 KB
testcase_16 AC 268 ms
37,888 KB
testcase_17 AC 292 ms
38,272 KB
testcase_18 AC 317 ms
38,440 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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)
0