結果

問題 No.2218 Multiple LIS
ユーザー qibqib
提出日時 2023-03-16 18:42:45
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 337 bytes
コンパイル時間 1,754 ms
コンパイル使用メモリ 81,368 KB
実行使用メモリ 234,188 KB
最終ジャッジ日時 2023-10-18 13:08:19
合計ジャッジ時間 11,456 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 47 ms
62,564 KB
testcase_01 AC 43 ms
60,244 KB
testcase_02 AC 51 ms
64,616 KB
testcase_03 AC 47 ms
62,432 KB
testcase_04 AC 47 ms
62,432 KB
testcase_05 AC 47 ms
62,564 KB
testcase_06 AC 46 ms
62,432 KB
testcase_07 AC 50 ms
64,624 KB
testcase_08 AC 48 ms
62,576 KB
testcase_09 AC 48 ms
62,580 KB
testcase_10 AC 45 ms
62,432 KB
testcase_11 AC 47 ms
62,568 KB
testcase_12 AC 85 ms
73,196 KB
testcase_13 AC 138 ms
77,756 KB
testcase_14 AC 141 ms
77,756 KB
testcase_15 AC 116 ms
77,744 KB
testcase_16 AC 67 ms
68,712 KB
testcase_17 AC 134 ms
77,752 KB
testcase_18 AC 52 ms
64,616 KB
testcase_19 AC 70 ms
69,100 KB
testcase_20 AC 126 ms
77,748 KB
testcase_21 AC 60 ms
67,332 KB
testcase_22 AC 79 ms
77,604 KB
testcase_23 AC 96 ms
85,668 KB
testcase_24 AC 64 ms
71,348 KB
testcase_25 AC 99 ms
86,896 KB
testcase_26 AC 123 ms
91,956 KB
testcase_27 AC 128 ms
92,220 KB
testcase_28 AC 125 ms
91,956 KB
testcase_29 AC 119 ms
91,956 KB
testcase_30 AC 121 ms
91,956 KB
testcase_31 TLE -
testcase_32 -- -
testcase_33 -- -
testcase_34 -- -
testcase_35 -- -
testcase_36 -- -
testcase_37 -- -
testcase_38 -- -
testcase_39 -- -
testcase_40 -- -
testcase_41 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
a = list(map(int, input().split()))

m = 10 ** 5
dp = [0 for _ in range(n)]
idx = [None for _ in range(m + 1)]
for i in range(n):
  if idx[a[i]] is None:
    dp[i] = 1
  else:
    dp[i] = dp[idx[a[i]]] + 1
  for x in range(a[i], m + 1, a[i]):
    if idx[x] is None or dp[idx[x]] < dp[i]:
      idx[x] = i

print(max(dp))
0