結果

問題 No.2035 Tunnel
ユーザー ニックネームニックネーム
提出日時 2022-08-12 21:36:36
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 137 ms / 2,000 ms
コード長 140 bytes
コンパイル時間 157 ms
コンパイル使用メモリ 11,816 KB
実行使用メモリ 10,812 KB
最終ジャッジ日時 2023-10-24 08:40:34
合計ジャッジ時間 3,131 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 28 ms
10,152 KB
testcase_01 AC 28 ms
10,152 KB
testcase_02 AC 28 ms
10,152 KB
testcase_03 AC 28 ms
10,152 KB
testcase_04 AC 28 ms
10,152 KB
testcase_05 AC 90 ms
10,812 KB
testcase_06 AC 88 ms
10,812 KB
testcase_07 AC 86 ms
10,812 KB
testcase_08 AC 30 ms
10,812 KB
testcase_09 AC 137 ms
10,812 KB
testcase_10 AC 71 ms
10,812 KB
testcase_11 AC 91 ms
10,608 KB
testcase_12 AC 105 ms
10,808 KB
testcase_13 AC 36 ms
10,240 KB
testcase_14 AC 48 ms
10,340 KB
testcase_15 AC 95 ms
10,640 KB
testcase_16 AC 80 ms
10,512 KB
testcase_17 AC 29 ms
10,160 KB
testcase_18 AC 34 ms
10,204 KB
testcase_19 AC 55 ms
10,356 KB
testcase_20 AC 90 ms
10,608 KB
testcase_21 AC 51 ms
10,280 KB
testcase_22 AC 51 ms
10,292 KB
testcase_23 AC 37 ms
10,240 KB
testcase_24 AC 59 ms
10,436 KB
testcase_25 AC 67 ms
10,516 KB
testcase_26 AC 64 ms
10,496 KB
testcase_27 AC 80 ms
10,780 KB
testcase_28 AC 53 ms
10,368 KB
testcase_29 AC 38 ms
10,268 KB
testcase_30 AC 36 ms
10,232 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
s = input()
s = s[s.find("#"):]
d = -1
for v in s[::-1]:
    if v == "#": d += 1
    else: d = max(d-1, -1)
print(len(s)+d)
0