結果

問題 No.2218 Multiple LIS
ユーザー chineristACchineristAC
提出日時 2023-02-17 23:18:21
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 671 ms / 3,000 ms
コード長 565 bytes
コンパイル時間 317 ms
コンパイル使用メモリ 87,188 KB
実行使用メモリ 95,724 KB
最終ジャッジ日時 2023-09-26 20:40:54
合計ジャッジ時間 12,661 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 106 ms
74,352 KB
testcase_01 AC 111 ms
74,572 KB
testcase_02 AC 107 ms
74,516 KB
testcase_03 AC 110 ms
74,960 KB
testcase_04 AC 109 ms
74,852 KB
testcase_05 AC 109 ms
74,660 KB
testcase_06 AC 107 ms
74,772 KB
testcase_07 AC 106 ms
74,500 KB
testcase_08 AC 109 ms
74,660 KB
testcase_09 AC 105 ms
74,420 KB
testcase_10 AC 105 ms
74,612 KB
testcase_11 AC 107 ms
74,680 KB
testcase_12 AC 113 ms
78,860 KB
testcase_13 AC 116 ms
79,496 KB
testcase_14 AC 116 ms
79,748 KB
testcase_15 AC 116 ms
79,736 KB
testcase_16 AC 111 ms
79,144 KB
testcase_17 AC 121 ms
79,884 KB
testcase_18 AC 111 ms
74,536 KB
testcase_19 AC 110 ms
79,144 KB
testcase_20 AC 115 ms
79,672 KB
testcase_21 AC 138 ms
80,712 KB
testcase_22 AC 268 ms
85,612 KB
testcase_23 AC 358 ms
89,256 KB
testcase_24 AC 178 ms
82,028 KB
testcase_25 AC 399 ms
90,676 KB
testcase_26 AC 523 ms
95,548 KB
testcase_27 AC 522 ms
95,292 KB
testcase_28 AC 513 ms
95,696 KB
testcase_29 AC 507 ms
95,384 KB
testcase_30 AC 500 ms
95,068 KB
testcase_31 AC 237 ms
94,352 KB
testcase_32 AC 263 ms
94,976 KB
testcase_33 AC 241 ms
94,516 KB
testcase_34 AC 239 ms
94,644 KB
testcase_35 AC 259 ms
94,772 KB
testcase_36 AC 129 ms
92,280 KB
testcase_37 AC 654 ms
95,724 KB
testcase_38 AC 108 ms
74,396 KB
testcase_39 AC 106 ms
74,568 KB
testcase_40 AC 671 ms
95,036 KB
testcase_41 AC 670 ms
94,848 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys,random,bisect
from collections import deque,defaultdict
from heapq import heapify,heappop,heappush
from itertools import permutations
from math import gcd,log

input = lambda :sys.stdin.readline().rstrip()
mi = lambda :map(int,input().split())
li = lambda :list(mi())

N = int(input())
A = li()

M = max(A)

dp = [0] * (M+1) 
for a in A:
    tmp = 1
    for d in range(1,a+1):
        if d*d > a:
            break

        if a % d == 0:
            tmp = max(tmp,dp[d]+1)
            tmp = max(tmp,dp[a//d]+1)
    dp[a] = max(dp[a],tmp)

print(max(dp))
0