結果
| 問題 |
No.979 Longest Divisor Sequence
|
| ユーザー |
vwxyz
|
| 提出日時 | 2024-04-19 23:24:59 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 324 bytes |
| コンパイル時間 | 154 ms |
| コンパイル使用メモリ | 12,672 KB |
| 実行使用メモリ | 23,132 KB |
| 最終ジャッジ日時 | 2024-10-11 18:02:05 |
| 合計ジャッジ時間 | 6,318 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 12 WA * 1 TLE * 1 -- * 2 |
ソースコード
from collections import defaultdict
import sys
readline=sys.stdin.readline
N=int(readline())
X=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