結果
| 問題 |
No.390 最長の数列
|
| コンテスト | |
| ユーザー |
vwxyz
|
| 提出日時 | 2022-09-27 16:12:57 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
TLE
(最新)
AC
(最初)
|
| 実行時間 | - |
| コード長 | 332 bytes |
| コンパイル時間 | 271 ms |
| コンパイル使用メモリ | 12,544 KB |
| 実行使用メモリ | 31,712 KB |
| 最終ジャッジ日時 | 2024-12-22 16:58:44 |
| 合計ジャッジ時間 | 14,379 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 14 TLE * 1 |
ソースコード
from collections import defaultdict
import sys
readline=sys.stdin.readline
N=int(readline())
X=sorted(list(map(int,readline().split())))
set_X=set(X)
dp=defaultdict(int)
for x in X:
dp[x]=max(dp[x],1)
for y in range(2*x,10**6+1,x):
if y in set_X:
dp[y]=max(dp[y],dp[x]+1)
ans=max(dp.values())
print(ans)
vwxyz