結果

問題 No.390 最長の数列
コンテスト
ユーザー ああいい
提出日時 2022-03-30 00:21:41
言語 PyPy3
(7.3.17)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
AC  
実行時間 677 ms / 5,000 ms
コード長 295 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 185 ms
コンパイル使用メモリ 85,300 KB
実行使用メモリ 111,012 KB
最終ジャッジ日時 2026-05-09 04:21:19
合計ジャッジ時間 4,373 ms
ジャッジサーバーID
(参考情報)
judge2_1 / judge3_1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 15
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

N = int(input())
x = list(map(int,input().split()))
x.sort()

d = dict()
for i in x:
    d[i] = 1
C = max(x) + 1
for i in x:
    u = d[i]
    for j in range(2 * i,C,i):
        if j in d:
            d[j] = max(d[j],u + 1)
ans = 0
for v in d.values():
    if v > ans:
        ans = v
print(ans)
0