結果

問題 No.390 最長の数列
ユーザー tookunn_1213tookunn_1213
提出日時 2016-07-09 17:10:20
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 224 ms / 5,000 ms
コード長 253 bytes
コンパイル時間 269 ms
コンパイル使用メモリ 82,696 KB
実行使用メモリ 97,848 KB
最終ジャッジ日時 2024-04-10 08:58:57
合計ジャッジ時間 2,627 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 42 ms
52,440 KB
testcase_01 AC 43 ms
53,136 KB
testcase_02 AC 39 ms
52,696 KB
testcase_03 AC 38 ms
52,688 KB
testcase_04 AC 40 ms
53,440 KB
testcase_05 AC 75 ms
91,148 KB
testcase_06 AC 224 ms
97,752 KB
testcase_07 AC 40 ms
52,608 KB
testcase_08 AC 48 ms
67,140 KB
testcase_09 AC 55 ms
66,312 KB
testcase_10 AC 104 ms
97,588 KB
testcase_11 AC 107 ms
97,772 KB
testcase_12 AC 110 ms
97,848 KB
testcase_13 AC 97 ms
90,312 KB
testcase_14 AC 84 ms
88,108 KB
testcase_15 AC 42 ms
59,056 KB
testcase_16 AC 51 ms
66,488 KB
testcase_17 AC 60 ms
72,392 KB
testcase_18 AC 61 ms
72,184 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
x =  list(map(int,input().split()))
M = max(x) + 1
dp = [0] * M
for i in x:
	dp[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