結果
| 問題 | No.1188 レベルX門松列 |
| コンテスト | |
| ユーザー |
37zigen
|
| 提出日時 | 2020-08-25 09:49:43 |
| 言語 | Python3 (3.14.3 + numpy 2.4.4 + scipy 1.17.1) |
| 結果 |
AC
|
| 実行時間 | 243 ms / 2,000 ms |
| コード長 | 456 bytes |
| 記録 | |
| コンパイル時間 | 556 ms |
| コンパイル使用メモリ | 20,828 KB |
| 実行使用メモリ | 25,100 KB |
| 最終ジャッジ日時 | 2026-05-06 15:08:27 |
| 合計ジャッジ時間 | 7,344 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 21 |
ソースコード
import bisect
N=int(input())
A=list(map(int,input().split()))
def f(n,a):
ret=0
dp=[10**20]*n
L=[-1]*n
for i in range(n):
to=bisect.bisect_left(dp,a[i])
dp[to]=a[i]
L[i]=to
a=a[::-1]
dp=[10**20]*n
for i in range(n):
to=bisect.bisect_left(dp,a[i])
dp[to]=a[i]
ret=max(ret,min(L[n-1-i],to))
return ret
ans=f(N,A)
for i in range(N):
A[i]=-A[i]
ans=max(ans,f(N,A))
print(ans)
37zigen