結果
| 問題 |
No.390 最長の数列
|
| コンテスト | |
| ユーザー |
H20
|
| 提出日時 | 2021-01-21 13:33:46 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 810 ms / 5,000 ms |
| コード長 | 273 bytes |
| コンパイル時間 | 381 ms |
| コンパイル使用メモリ | 81,792 KB |
| 実行使用メモリ | 106,880 KB |
| 最終ジャッジ日時 | 2024-12-24 13:12:59 |
| 合計ジャッジ時間 | 3,949 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 15 |
ソースコード
import bisect
import collections
N = int(input())
A = list(map(int,input().split()))
CA = collections.Counter(A)
MA = max(A)
A.sort()
for a in A:
i=2
while MA>=a*i:
if CA[a*i]>0:
CA[a*i]=max(CA[a*i],CA[a]+1)
i+=1
print(max(CA.values()))
H20