結果

問題 No.2035 Tunnel
ユーザー hir355hir355
提出日時 2022-08-12 21:24:12
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 51 ms / 2,000 ms
コード長 200 bytes
コンパイル時間 288 ms
コンパイル使用メモリ 81,908 KB
実行使用メモリ 62,192 KB
最終ジャッジ日時 2023-10-24 08:00:08
合計ジャッジ時間 2,702 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 38 ms
53,324 KB
testcase_01 AC 38 ms
53,324 KB
testcase_02 AC 38 ms
53,324 KB
testcase_03 AC 37 ms
53,324 KB
testcase_04 AC 38 ms
53,324 KB
testcase_05 AC 47 ms
60,124 KB
testcase_06 AC 49 ms
62,172 KB
testcase_07 AC 49 ms
62,192 KB
testcase_08 AC 44 ms
60,116 KB
testcase_09 AC 45 ms
60,116 KB
testcase_10 AC 46 ms
60,116 KB
testcase_11 AC 49 ms
62,008 KB
testcase_12 AC 51 ms
62,156 KB
testcase_13 AC 44 ms
59,496 KB
testcase_14 AC 46 ms
59,496 KB
testcase_15 AC 48 ms
62,044 KB
testcase_16 AC 46 ms
59,868 KB
testcase_17 AC 44 ms
59,496 KB
testcase_18 AC 44 ms
59,496 KB
testcase_19 AC 46 ms
59,496 KB
testcase_20 AC 48 ms
59,964 KB
testcase_21 AC 45 ms
59,496 KB
testcase_22 AC 45 ms
59,496 KB
testcase_23 AC 44 ms
59,496 KB
testcase_24 AC 45 ms
59,792 KB
testcase_25 AC 46 ms
59,876 KB
testcase_26 AC 46 ms
59,848 KB
testcase_27 AC 48 ms
60,036 KB
testcase_28 AC 45 ms
59,496 KB
testcase_29 AC 43 ms
59,496 KB
testcase_30 AC 43 ms
59,496 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
s = input()
t = 0
ans = 0
for i in range(n - 1, -1, -1):
    if s[i] == '#':
        ans = max(ans, n - i + t)
        t += 1
    else:
        if t > 0:
            t -= 1
print(ans)
0