結果

問題 No.2218 Multiple LIS
ユーザー 👑 timitimi
提出日時 2023-02-17 21:51:30
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 773 ms / 3,000 ms
コード長 534 bytes
コンパイル時間 430 ms
コンパイル使用メモリ 86,988 KB
実行使用メモリ 90,764 KB
最終ジャッジ日時 2023-09-26 19:08:57
合計ジャッジ時間 12,065 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 75 ms
71,216 KB
testcase_01 AC 75 ms
71,040 KB
testcase_02 AC 73 ms
71,212 KB
testcase_03 AC 73 ms
70,892 KB
testcase_04 AC 74 ms
71,088 KB
testcase_05 AC 75 ms
71,240 KB
testcase_06 AC 75 ms
71,140 KB
testcase_07 AC 74 ms
71,272 KB
testcase_08 AC 74 ms
71,040 KB
testcase_09 AC 74 ms
71,196 KB
testcase_10 AC 75 ms
70,924 KB
testcase_11 AC 74 ms
71,140 KB
testcase_12 AC 81 ms
75,788 KB
testcase_13 AC 88 ms
76,284 KB
testcase_14 AC 90 ms
76,344 KB
testcase_15 AC 90 ms
76,292 KB
testcase_16 AC 77 ms
75,164 KB
testcase_17 AC 87 ms
76,264 KB
testcase_18 AC 74 ms
70,948 KB
testcase_19 AC 76 ms
75,364 KB
testcase_20 AC 87 ms
76,276 KB
testcase_21 AC 112 ms
76,532 KB
testcase_22 AC 268 ms
81,224 KB
testcase_23 AC 398 ms
84,536 KB
testcase_24 AC 151 ms
78,184 KB
testcase_25 AC 438 ms
85,744 KB
testcase_26 AC 594 ms
90,492 KB
testcase_27 AC 597 ms
90,556 KB
testcase_28 AC 595 ms
90,464 KB
testcase_29 AC 589 ms
90,712 KB
testcase_30 AC 588 ms
90,684 KB
testcase_31 AC 256 ms
89,856 KB
testcase_32 AC 276 ms
89,944 KB
testcase_33 AC 242 ms
89,912 KB
testcase_34 AC 243 ms
89,948 KB
testcase_35 AC 277 ms
89,976 KB
testcase_36 AC 113 ms
89,276 KB
testcase_37 AC 773 ms
90,764 KB
testcase_38 AC 73 ms
71,208 KB
testcase_39 AC 73 ms
71,300 KB
testcase_40 AC 749 ms
90,460 KB
testcase_41 AC 748 ms
90,660 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#N,K=map(int, input().split())
N=int(input())
A=list(map(int, input().split()))
D={}
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]
for a in A:
  B=make_divisors(a)
  d=1
  for b in B:
    if b in D:
      d=max(d,D[b]+1)
  if a not in D:
    D[a]=0
  D[a]=d 
print(max(D.values()))
    
0