結果
問題 |
No.390 最長の数列
|
ユーザー |
![]() |
提出日時 | 2016-07-11 00:19:31 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
RE
|
実行時間 | - |
コード長 | 436 bytes |
コンパイル時間 | 167 ms |
コンパイル使用メモリ | 12,416 KB |
実行使用メモリ | 35,700 KB |
最終ジャッジ日時 | 2024-10-13 10:33:50 |
合計ジャッジ時間 | 6,941 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 RE * 2 |
other | RE * 1 TLE * 1 -- * 13 |
ソースコード
def get_divisor(n): divisor = [] for i in range(1, n//2+1): if n % i == 0: divisor.append(i) divisor.append(n//i) return 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)]) # length[e] = max([length[d]+1 for d in get_divisor(e)]) print(max(length))