結果
| 問題 |
No.3210 Fixed Sign Sequense
|
| コンテスト | |
| ユーザー |
sasa8uyauya
|
| 提出日時 | 2025-07-25 21:26:35 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 156 ms / 2,000 ms |
| コード長 | 263 bytes |
| コンパイル時間 | 433 ms |
| コンパイル使用メモリ | 82,592 KB |
| 実行使用メモリ | 83,260 KB |
| 最終ジャッジ日時 | 2025-07-25 21:26:48 |
| 合計ジャッジ時間 | 6,163 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 38 |
ソースコード
n=int(input())
s=input()
a=[0]*n
c1=0
c2=n
for i in range(n):
if s[i]=="+":
c1+=1
a[i]=c1
elif s[i]=="-":
a[i]=-c2
c2-=1
q=[n+1]*(n+1)
from bisect import bisect_left
for v in a:
q[bisect_left(q,v)]=v
while q[-1]==n+1:
q.pop()
print(len(q))
sasa8uyauya