結果
| 問題 | No.979 Longest Divisor Sequence |
| コンテスト | |
| ユーザー |
SPD_9X2
|
| 提出日時 | 2020-02-01 00:34:13 |
| 言語 | Python3 (3.14.7 + numpy 2.5.2 + scipy 1.18.0 + ACL) |
| 結果 |
TLE
不安定
|
| 実行時間 | - |
| コード長 | 559 bytes |
| 記録 | |
| コンパイル時間 | 310 ms |
| コンパイル使用メモリ | 21,412 KB |
| 実行使用メモリ | 54,368 KB |
| 最終ジャッジ日時 | 2026-08-29 13:44:11 |
| 合計ジャッジ時間 | 7,613 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 14 TLE * 1 -- * 1 |
ソースコード
N = int(input())
A = list(map(int,input().split()))
lis = [ [] for i in range(3*(10**5)+1) ]
maxlen = [0] * N
for loop in range(N):
na = A[loop]
for i in range(int(na**0.5)+1):
i += 1
if na % i == 0:
if i < na:
for j in lis[i]:
maxlen[loop] = max(maxlen[loop] , maxlen[j] + 1)
if na // i < na:
for j in lis[na//i]:
maxlen[loop] = max(maxlen[loop] , maxlen[j] + 1)
lis[na].append(loop)
#print (maxlen)
print (max(maxlen)+1)
SPD_9X2