結果
| 問題 | No.1188 レベルX門松列 |
| コンテスト | |
| ユーザー |
37zigen
|
| 提出日時 | 2020-08-25 09:58:32 |
| 言語 | Python3 (3.14.3 + numpy 2.4.4 + scipy 1.17.1) |
| 結果 |
AC
|
| 実行時間 | 254 ms / 2,000 ms |
| コード長 | 455 bytes |
| 記録 | |
| コンパイル時間 | 622 ms |
| コンパイル使用メモリ | 20,700 KB |
| 実行使用メモリ | 27,764 KB |
| 最終ジャッジ日時 | 2026-05-06 15:09:25 |
| 合計ジャッジ時間 | 8,377 ms |
|
ジャッジサーバーID (参考情報) |
judge3_1 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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