結果

問題 No.390 最長の数列
ユーザー tookunn_1213tookunn_1213
提出日時 2016-07-09 18:22:17
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 256 bytes
コンパイル時間 120 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 24,040 KB
最終ジャッジ日時 2024-04-21 10:47:49
合計ジャッジ時間 6,869 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 25 ms
10,624 KB
testcase_01 AC 26 ms
10,752 KB
testcase_02 AC 28 ms
10,624 KB
testcase_03 AC 25 ms
10,752 KB
testcase_04 WA -
testcase_05 AC 154 ms
24,036 KB
testcase_06 AC 2,761 ms
24,032 KB
testcase_07 AC 27 ms
10,752 KB
testcase_08 AC 57 ms
18,560 KB
testcase_09 AC 166 ms
18,432 KB
testcase_10 AC 349 ms
24,040 KB
testcase_11 AC 374 ms
23,992 KB
testcase_12 AC 358 ms
23,992 KB
testcase_13 AC 496 ms
23,248 KB
testcase_14 AC 660 ms
23,576 KB
testcase_15 AC 28 ms
10,752 KB
testcase_16 AC 58 ms
18,304 KB
testcase_17 AC 68 ms
18,944 KB
testcase_18 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
x =  list(set(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(N):
	for j in range(x[i] * 2,M,x[i]):
		if dp[j] == 0:
			continue
		dp[j] = max(dp[j],dp[x[i]] + 1)
print (max(dp))
0