結果

問題 No.390 最長の数列
ユーザー tookunn_1213tookunn_1213
提出日時 2016-07-09 17:10:44
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 221 ms / 5,000 ms
コード長 263 bytes
コンパイル時間 273 ms
コンパイル使用メモリ 82,512 KB
実行使用メモリ 98,140 KB
最終ジャッジ日時 2024-04-10 08:59:05
合計ジャッジ時間 2,373 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 40 ms
53,236 KB
testcase_01 AC 38 ms
53,668 KB
testcase_02 AC 38 ms
53,536 KB
testcase_03 AC 37 ms
52,584 KB
testcase_04 AC 42 ms
52,000 KB
testcase_05 AC 74 ms
91,372 KB
testcase_06 AC 221 ms
97,540 KB
testcase_07 AC 38 ms
52,428 KB
testcase_08 AC 49 ms
66,808 KB
testcase_09 AC 54 ms
66,380 KB
testcase_10 AC 103 ms
97,672 KB
testcase_11 AC 105 ms
97,760 KB
testcase_12 AC 109 ms
98,140 KB
testcase_13 AC 93 ms
91,236 KB
testcase_14 AC 81 ms
88,164 KB
testcase_15 AC 41 ms
57,712 KB
testcase_16 AC 51 ms
66,280 KB
testcase_17 AC 58 ms
71,580 KB
testcase_18 AC 59 ms
72,024 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
x =  list(map(int,input().split()))
M = max(x) + 1
dp = [0] * M
for i in range(N):
	dp[x[i]] = 1
for i in range(M):
	if dp[i] == 0:
		continue
	for j in range(i + i,M,i):
		if dp[j] == 0:
			continue
		dp[j] = max(dp[j],dp[i] + 1)
print (max(dp))
0