結果

問題 No.2218 Multiple LIS
ユーザー shobonvipshobonvip
提出日時 2023-02-17 21:23:17
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 751 ms / 3,000 ms
コード長 426 bytes
コンパイル時間 444 ms
コンパイル使用メモリ 86,712 KB
実行使用メモリ 91,724 KB
最終ジャッジ日時 2023-09-26 18:27:32
合計ジャッジ時間 12,626 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 75 ms
75,644 KB
testcase_01 AC 81 ms
75,804 KB
testcase_02 AC 78 ms
75,932 KB
testcase_03 AC 75 ms
75,896 KB
testcase_04 AC 76 ms
76,108 KB
testcase_05 AC 77 ms
75,960 KB
testcase_06 AC 77 ms
75,552 KB
testcase_07 AC 76 ms
75,808 KB
testcase_08 AC 76 ms
75,628 KB
testcase_09 AC 76 ms
75,764 KB
testcase_10 AC 76 ms
75,632 KB
testcase_11 AC 76 ms
75,752 KB
testcase_12 AC 80 ms
76,544 KB
testcase_13 AC 87 ms
77,236 KB
testcase_14 AC 89 ms
76,916 KB
testcase_15 AC 90 ms
77,024 KB
testcase_16 AC 79 ms
76,092 KB
testcase_17 AC 90 ms
77,408 KB
testcase_18 AC 78 ms
75,956 KB
testcase_19 AC 79 ms
76,320 KB
testcase_20 AC 88 ms
77,288 KB
testcase_21 AC 112 ms
77,432 KB
testcase_22 AC 247 ms
81,624 KB
testcase_23 AC 354 ms
85,160 KB
testcase_24 AC 144 ms
78,056 KB
testcase_25 AC 386 ms
86,516 KB
testcase_26 AC 510 ms
91,388 KB
testcase_27 AC 512 ms
91,232 KB
testcase_28 AC 515 ms
91,344 KB
testcase_29 AC 509 ms
91,356 KB
testcase_30 AC 505 ms
91,576 KB
testcase_31 AC 233 ms
90,740 KB
testcase_32 AC 259 ms
90,776 KB
testcase_33 AC 227 ms
90,564 KB
testcase_34 AC 227 ms
90,644 KB
testcase_35 AC 255 ms
90,792 KB
testcase_36 AC 112 ms
90,156 KB
testcase_37 AC 751 ms
91,724 KB
testcase_38 AC 75 ms
75,636 KB
testcase_39 AC 75 ms
76,068 KB
testcase_40 AC 714 ms
91,248 KB
testcase_41 AC 719 ms
91,352 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def makediv(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()))
v = [0] * 100002
for i in range(n):
	tmp = 0
	for j in makediv(a[i]):
		tmp = max(tmp, v[j])
	v[a[i]] = max(v[a[i]], tmp + 1)

print(max(v))
0