結果
| 問題 | No.1188 レベルX門松列 |
| コンテスト | |
| ユーザー |
37zigen
|
| 提出日時 | 2020-08-25 09:58:32 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
AC
|
| 実行時間 | 367 ms / 2,000 ms |
| コード長 | 455 bytes |
| コンパイル時間 | 211 ms |
| コンパイル使用メモリ | 12,800 KB |
| 実行使用メモリ | 24,072 KB |
| 最終ジャッジ日時 | 2024-11-06 11:06:23 |
| 合計ジャッジ時間 | 5,723 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 21 |
ソースコード
import bisect
N=int(input())
A=list(map(int,input().split()))
def f(n,a):
ret=0
def g(n,a):
dp=[10**20]*n
A=[0]*n
for i,a in enumerate(a):
to=bisect.bisect_left(dp,a)
dp[to]=a
A[i]=to
return A
L=g(n,a)
R=g(n,a[::-1])[::-1]
for i in range(n):
ret=max(ret,min(L[i],R[i]))
return ret
ans=f(N,A)
for i in range(N):
A[i]*=-1
ans=max(ans,f(N,A))
print(ans)
37zigen