結果

問題 No.390 最長の数列
ユーザー hanorver
提出日時 2016-09-11 12:43:28
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
TLE  
実行時間 -
コード長 173 bytes
コンパイル時間 245 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 47,692 KB
最終ジャッジ日時 2024-11-17 03:21:51
合計ジャッジ時間 46,039 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 8 TLE * 7
権限があれば一括ダウンロードができます

ソースコード

diff #

input()
n=sorted(map(int,input().split()))
m=max(n)
dp=[1 for i in[0]*(m+1)]
for i in n:
 for j in range(2,m//i+1):
  if i*j in n:dp[i*j]=max(dp[i*j],dp[i]+1)
print(max(dp))
0