結果

問題 No.2218 Multiple LIS
ユーザー 👑 H20H20
提出日時 2023-02-17 22:03:02
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 808 ms / 3,000 ms
コード長 530 bytes
コンパイル時間 278 ms
コンパイル使用メモリ 86,792 KB
実行使用メモリ 93,228 KB
最終ジャッジ日時 2023-09-26 19:19:53
合計ジャッジ時間 12,681 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 90 ms
71,220 KB
testcase_01 AC 90 ms
71,408 KB
testcase_02 AC 94 ms
71,560 KB
testcase_03 AC 90 ms
71,384 KB
testcase_04 AC 90 ms
71,576 KB
testcase_05 AC 88 ms
71,608 KB
testcase_06 AC 91 ms
71,476 KB
testcase_07 AC 91 ms
71,372 KB
testcase_08 AC 91 ms
71,500 KB
testcase_09 AC 91 ms
71,380 KB
testcase_10 AC 90 ms
71,384 KB
testcase_11 AC 93 ms
71,216 KB
testcase_12 AC 105 ms
76,736 KB
testcase_13 AC 113 ms
77,372 KB
testcase_14 AC 105 ms
77,300 KB
testcase_15 AC 107 ms
77,356 KB
testcase_16 AC 95 ms
76,380 KB
testcase_17 AC 105 ms
77,236 KB
testcase_18 AC 92 ms
71,300 KB
testcase_19 AC 98 ms
76,372 KB
testcase_20 AC 106 ms
77,252 KB
testcase_21 AC 134 ms
79,384 KB
testcase_22 AC 282 ms
85,856 KB
testcase_23 AC 412 ms
87,656 KB
testcase_24 AC 168 ms
80,988 KB
testcase_25 AC 451 ms
88,364 KB
testcase_26 AC 588 ms
92,952 KB
testcase_27 AC 601 ms
93,220 KB
testcase_28 AC 597 ms
93,128 KB
testcase_29 AC 597 ms
93,228 KB
testcase_30 AC 592 ms
93,188 KB
testcase_31 AC 265 ms
90,892 KB
testcase_32 AC 287 ms
90,852 KB
testcase_33 AC 260 ms
90,724 KB
testcase_34 AC 257 ms
90,868 KB
testcase_35 AC 285 ms
90,760 KB
testcase_36 AC 134 ms
92,580 KB
testcase_37 AC 808 ms
91,740 KB
testcase_38 AC 91 ms
71,408 KB
testcase_39 AC 89 ms
71,384 KB
testcase_40 AC 755 ms
91,348 KB
testcase_41 AC 753 ms
91,592 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import collections
def make_divisors(n):
    lower_divisors , upper_divisors = [], []
    i = 1
    while i*i <= n:
        if n % i == 0:
            lower_divisors.append(i)
            if i != n // i:
                upper_divisors.append(n//i)
        i += 1
    return lower_divisors + upper_divisors[::-1]
N = int(input())
A = list(map(int, input().split())) 
D = collections.defaultdict(int)
for a in A:
    DIV = make_divisors(a)
    v = 0
    for div in DIV:
        v = max(v,D[div]+1)
    D[a]=v

print(max(D.values()))
0