結果

問題 No.2035 Tunnel
ユーザー gr1msl3y
提出日時 2022-08-15 22:41:11
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 156 bytes
コンパイル時間 313 ms
コンパイル使用メモリ 82,248 KB
実行使用メモリ 76,052 KB
最終ジャッジ日時 2024-10-02 10:31:47
合計ジャッジ時間 2,638 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 17 WA * 11
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
S = input()
ans = N-S.index('#')
v = -1
w = 0
for s in S:
    v += 1 if s == '#' else -1
    v = max(-1, v)
    w = max(v, w)
print(ans+w)
0