結果

問題 No.2218 Multiple LIS
ユーザー ShirotsumeShirotsume
提出日時 2023-02-14 07:34:20
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 683 bytes
コンパイル時間 291 ms
コンパイル使用メモリ 87,124 KB
実行使用メモリ 104,016 KB
最終ジャッジ日時 2023-09-23 17:33:31
合計ジャッジ時間 16,510 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 94 ms
75,880 KB
testcase_01 AC 93 ms
71,564 KB
testcase_02 AC 94 ms
71,776 KB
testcase_03 AC 93 ms
71,600 KB
testcase_04 AC 92 ms
71,568 KB
testcase_05 AC 92 ms
71,588 KB
testcase_06 AC 93 ms
71,588 KB
testcase_07 AC 92 ms
71,292 KB
testcase_08 AC 92 ms
71,388 KB
testcase_09 AC 93 ms
71,592 KB
testcase_10 AC 93 ms
71,700 KB
testcase_11 AC 106 ms
76,832 KB
testcase_12 AC 103 ms
76,964 KB
testcase_13 AC 110 ms
77,324 KB
testcase_14 AC 107 ms
77,408 KB
testcase_15 AC 110 ms
77,476 KB
testcase_16 AC 102 ms
77,040 KB
testcase_17 AC 110 ms
77,312 KB
testcase_18 AC 99 ms
77,128 KB
testcase_19 AC 103 ms
77,128 KB
testcase_20 AC 110 ms
77,364 KB
testcase_21 AC 541 ms
79,640 KB
testcase_22 AC 2,604 ms
92,052 KB
testcase_23 TLE -
testcase_24 AC 1,080 ms
88,244 KB
testcase_25 TLE -
testcase_26 -- -
testcase_27 -- -
testcase_28 -- -
testcase_29 -- -
testcase_30 -- -
testcase_31 -- -
testcase_32 -- -
testcase_33 -- -
testcase_34 -- -
testcase_35 -- -
testcase_36 -- -
testcase_37 -- -
testcase_38 -- -
testcase_39 -- -
testcase_40 -- -
testcase_41 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
from collections import deque, Counter
input = lambda: sys.stdin.readline().rstrip()
ii = lambda: int(input())
mi = lambda: map(int, input().split())
li = lambda: list(mi())
inf = 2 ** 63 - 1
mod = 998244353

n = ii()

a = li()

dp = [-inf] * (n + 1)
dp[0] = 1
maxi = [0] * (max(a) + 1)
div = [set() for _ in range(max(a) + 1)]
for idx, v in enumerate(a):
    v2 = v
    if not div[v]:
        for i in range(1, v2 + 1):
            if i * i > v2:
                continue
            if v2 % i == 0:
                div[v].add(i)
                div[v].add(v2 // i)
    for v2 in div[v]:
        dp[idx] = max(dp[idx], maxi[v2] + 1)
    maxi[v] = dp[idx]

print(max(dp))
0