結果

問題 No.2218 Multiple LIS
ユーザー flygonflygon
提出日時 2023-02-17 21:39:28
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 846 ms / 3,000 ms
コード長 542 bytes
コンパイル時間 978 ms
コンパイル使用メモリ 86,904 KB
実行使用メモリ 93,720 KB
最終ジャッジ日時 2023-09-26 18:52:14
合計ジャッジ時間 13,446 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 94 ms
71,852 KB
testcase_01 AC 91 ms
71,144 KB
testcase_02 AC 93 ms
71,928 KB
testcase_03 AC 93 ms
71,380 KB
testcase_04 AC 92 ms
71,824 KB
testcase_05 AC 93 ms
71,684 KB
testcase_06 AC 93 ms
71,904 KB
testcase_07 AC 90 ms
71,564 KB
testcase_08 AC 92 ms
71,736 KB
testcase_09 AC 94 ms
71,672 KB
testcase_10 AC 93 ms
71,740 KB
testcase_11 AC 94 ms
71,740 KB
testcase_12 AC 102 ms
77,104 KB
testcase_13 AC 116 ms
77,760 KB
testcase_14 AC 111 ms
77,844 KB
testcase_15 AC 108 ms
78,004 KB
testcase_16 AC 97 ms
76,756 KB
testcase_17 AC 109 ms
77,660 KB
testcase_18 AC 93 ms
71,884 KB
testcase_19 AC 98 ms
76,560 KB
testcase_20 AC 109 ms
77,672 KB
testcase_21 AC 141 ms
79,660 KB
testcase_22 AC 302 ms
84,780 KB
testcase_23 AC 430 ms
87,920 KB
testcase_24 AC 177 ms
81,184 KB
testcase_25 AC 466 ms
88,152 KB
testcase_26 AC 617 ms
93,524 KB
testcase_27 AC 626 ms
93,600 KB
testcase_28 AC 621 ms
93,164 KB
testcase_29 AC 628 ms
93,136 KB
testcase_30 AC 618 ms
93,720 KB
testcase_31 AC 278 ms
91,208 KB
testcase_32 AC 296 ms
91,352 KB
testcase_33 AC 280 ms
91,180 KB
testcase_34 AC 280 ms
91,152 KB
testcase_35 AC 295 ms
91,184 KB
testcase_36 AC 135 ms
90,500 KB
testcase_37 AC 846 ms
91,944 KB
testcase_38 AC 94 ms
71,752 KB
testcase_39 AC 90 ms
72,016 KB
testcase_40 AC 722 ms
91,508 KB
testcase_41 AC 730 ms
91,628 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
sys.setrecursionlimit(5*10**5)
input = sys.stdin.readline
from collections import defaultdict, deque, Counter
from heapq import heappop, heappush
from bisect import bisect_left, bisect_right
from math import gcd

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

def fact(n):
  l = set()
  for i in range(1,int(pow(n,0.5))+1):
    if n % i == 0:
      l.add(i)
      l.add(n//i)
  return l
for i in range(n):
  mx = 0
  for j in fact(a[i]):
    mx = max(mx, d[j])
  d[a[i]] = mx + 1


print(max(d.values()))
0