結果
| 問題 |
No.2218 Multiple LIS
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2023-02-17 23:02:51 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 663 ms / 3,000 ms |
| コード長 | 364 bytes |
| コンパイル時間 | 320 ms |
| コンパイル使用メモリ | 82,660 KB |
| 実行使用メモリ | 91,176 KB |
| 最終ジャッジ日時 | 2024-07-19 14:15:29 |
| 合計ジャッジ時間 | 8,903 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 39 |
ソースコード
n=int(input())
A=list(map(int,input().split()))
B=[0]+[0]+[-10**5]*10**5
for i in range(n):
if A[i]!=1:
B[A[i]]+=1
B[A[i]]=max(B[1]+1,B[A[i]])
for q in range(2,320):
if q**2>A[i]:
break
if A[i]%q==0:
B[A[i]]=max(B[A[i]],B[q]+1)
B[A[i]]=max(B[A[i]],B[A[i]//q]+1)
ans=max(B)
#print(B)
print(ans)