結果
| 問題 |
No.390 最長の数列
|
| コンテスト | |
| ユーザー |
matsu7874
|
| 提出日時 | 2016-07-11 00:21:59 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 397 bytes |
| コンパイル時間 | 202 ms |
| コンパイル使用メモリ | 12,416 KB |
| 実行使用メモリ | 31,772 KB |
| 最終ジャッジ日時 | 2024-10-13 10:33:57 |
| 合計ジャッジ時間 | 6,889 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 1 TLE * 1 -- * 13 |
ソースコード
def get_divisor(n):
divisor = set()
divisor.add(1)
for i in range(1, n//2+1):
if n % i == 0:
divisor.add(i)
divisor.add(n//i)
return list(divisor)
n = int(input())
x = list(map(int, input().split()))
x.sort()
length = [0 for i in range(max(x)+1)]
for e in x:
length[e] = max(length[e], *[length[d]+1 for d in get_divisor(e)])
print(max(length))
matsu7874