結果

問題 No.390 最長の数列
ユーザー pluto77pluto77
提出日時 2016-10-19 09:14:11
言語 Python2
(2.7.18)
結果
AC  
実行時間 2,545 ms / 5,000 ms
コード長 252 bytes
コンパイル時間 334 ms
コンパイル使用メモリ 7,072 KB
実行使用メモリ 18,492 KB
最終ジャッジ日時 2024-04-10 10:12:33
合計ジャッジ時間 6,831 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 12 ms
6,816 KB
testcase_01 AC 11 ms
6,940 KB
testcase_02 AC 13 ms
6,944 KB
testcase_03 AC 12 ms
6,944 KB
testcase_04 AC 11 ms
6,940 KB
testcase_05 AC 216 ms
18,472 KB
testcase_06 AC 2,545 ms
18,208 KB
testcase_07 AC 11 ms
6,944 KB
testcase_08 AC 64 ms
14,208 KB
testcase_09 AC 133 ms
14,208 KB
testcase_10 AC 377 ms
18,472 KB
testcase_11 AC 397 ms
18,492 KB
testcase_12 AC 359 ms
18,468 KB
testcase_13 AC 379 ms
17,532 KB
testcase_14 AC 613 ms
14,996 KB
testcase_15 AC 11 ms
6,940 KB
testcase_16 AC 60 ms
14,080 KB
testcase_17 AC 72 ms
14,464 KB
testcase_18 AC 81 ms
14,564 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#yuki_390

n=int(raw_input())
s=map(int,raw_input().split())
s.sort()
r=[0 for i in xrange(s[-1]+1)]
for i in s:
 r[i]=1
res=1
for i in s:
 for j in xrange(i*2,s[-1]+1,i):
  if r[j]!=0:
   if r[i]>r[j]-1:
    r[j]=r[i]+1
   res=max(res,r[j])
print res
0