結果
問題 |
No.3210 Fixed Sign Sequense
|
ユーザー |
|
提出日時 | 2025-07-27 09:11:06 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
WA
|
実行時間 | - |
コード長 | 222 bytes |
コンパイル時間 | 260 ms |
コンパイル使用メモリ | 11,904 KB |
実行使用メモリ | 11,132 KB |
最終ジャッジ日時 | 2025-07-27 09:11:13 |
合計ジャッジ時間 | 5,465 ms |
ジャッジサーバーID (参考情報) |
judge6 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 30 WA * 8 |
ソースコード
n = int(input()) s = input() m = 0 p = s.count("+") ans = max(p, s.count("-")) for i in range(n): if s[i] == "-": m += 1 elif s[i] == "+": p -= 1 else: ans = max(ans, m+p+1) print(ans)