結果

問題 No.2218 Multiple LIS
ユーザー meruuu61779999meruuu61779999
提出日時 2023-02-17 21:51:23
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 813 ms / 3,000 ms
コード長 665 bytes
コンパイル時間 341 ms
コンパイル使用メモリ 86,984 KB
実行使用メモリ 90,872 KB
最終ジャッジ日時 2023-09-26 19:08:32
合計ジャッジ時間 11,460 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 78 ms
75,872 KB
testcase_01 AC 79 ms
75,768 KB
testcase_02 AC 79 ms
75,816 KB
testcase_03 AC 81 ms
75,664 KB
testcase_04 AC 79 ms
75,724 KB
testcase_05 AC 79 ms
75,820 KB
testcase_06 AC 80 ms
75,868 KB
testcase_07 AC 78 ms
75,672 KB
testcase_08 AC 80 ms
75,868 KB
testcase_09 AC 79 ms
75,944 KB
testcase_10 AC 78 ms
75,756 KB
testcase_11 AC 79 ms
75,760 KB
testcase_12 AC 82 ms
76,412 KB
testcase_13 AC 89 ms
76,944 KB
testcase_14 AC 90 ms
76,936 KB
testcase_15 AC 89 ms
77,300 KB
testcase_16 AC 79 ms
76,308 KB
testcase_17 AC 92 ms
77,152 KB
testcase_18 AC 79 ms
75,860 KB
testcase_19 AC 80 ms
76,348 KB
testcase_20 AC 90 ms
77,388 KB
testcase_21 AC 115 ms
77,512 KB
testcase_22 AC 259 ms
81,408 KB
testcase_23 AC 375 ms
84,792 KB
testcase_24 AC 147 ms
77,768 KB
testcase_25 AC 416 ms
86,072 KB
testcase_26 AC 545 ms
90,696 KB
testcase_27 AC 540 ms
90,836 KB
testcase_28 AC 540 ms
90,792 KB
testcase_29 AC 539 ms
90,744 KB
testcase_30 AC 535 ms
90,736 KB
testcase_31 AC 242 ms
90,320 KB
testcase_32 AC 255 ms
90,160 KB
testcase_33 AC 243 ms
90,324 KB
testcase_34 AC 239 ms
90,292 KB
testcase_35 AC 255 ms
90,208 KB
testcase_36 AC 113 ms
90,112 KB
testcase_37 AC 813 ms
90,872 KB
testcase_38 AC 75 ms
75,948 KB
testcase_39 AC 76 ms
75,856 KB
testcase_40 AC 685 ms
90,624 KB
testcase_41 AC 686 ms
90,680 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys

inputs = sys.stdin.readline

"""再帰関数のときセット
sys.setrecursionlimit(10**7)
import pypyjit
pypyjit.set_param('max_unroll_recursion=-1')
"""


def f(x):
    ret = set()
    for i in range(1, x + 1):
        if i * i > x:
            break
        if x % i == 0:
            ret.add(i)
            ret.add(x // i)
    return ret


def main():
    N = int(inputs())
    A = list(map(int, inputs().split()))

    R = [0] * (10 ** 5 + 1)
    for a in A:
        se = f(a)
        max_val = 0
        for el in se:
            max_val = max(max_val, R[el] + 1)
        R[a] = max_val

    print(max(R))


if __name__ == '__main__':
    main()
0