結果

問題 No.2035 Tunnel
ユーザー gr1msl3ygr1msl3y
提出日時 2022-08-15 22:47:36
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 57 ms / 2,000 ms
コード長 166 bytes
コンパイル時間 146 ms
コンパイル使用メモリ 82,208 KB
実行使用メモリ 76,144 KB
最終ジャッジ日時 2024-04-10 08:52:50
合計ジャッジ時間 2,689 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 36 ms
52,300 KB
testcase_01 AC 37 ms
52,512 KB
testcase_02 AC 36 ms
52,616 KB
testcase_03 AC 36 ms
52,876 KB
testcase_04 AC 38 ms
52,752 KB
testcase_05 AC 57 ms
75,748 KB
testcase_06 AC 55 ms
75,864 KB
testcase_07 AC 55 ms
76,144 KB
testcase_08 AC 37 ms
54,112 KB
testcase_09 AC 50 ms
75,700 KB
testcase_10 AC 43 ms
60,996 KB
testcase_11 AC 53 ms
75,952 KB
testcase_12 AC 54 ms
75,448 KB
testcase_13 AC 41 ms
61,432 KB
testcase_14 AC 44 ms
64,832 KB
testcase_15 AC 54 ms
75,700 KB
testcase_16 AC 49 ms
72,896 KB
testcase_17 AC 42 ms
60,492 KB
testcase_18 AC 43 ms
60,372 KB
testcase_19 AC 46 ms
66,192 KB
testcase_20 AC 52 ms
75,476 KB
testcase_21 AC 45 ms
66,928 KB
testcase_22 AC 46 ms
68,188 KB
testcase_23 AC 44 ms
62,140 KB
testcase_24 AC 49 ms
70,756 KB
testcase_25 AC 48 ms
72,172 KB
testcase_26 AC 48 ms
71,996 KB
testcase_27 AC 54 ms
75,872 KB
testcase_28 AC 46 ms
68,416 KB
testcase_29 AC 44 ms
63,772 KB
testcase_30 AC 43 ms
62,428 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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