結果

問題 No.2035 Tunnel
ユーザー rlangevinrlangevin
提出日時 2022-08-21 16:41:16
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 79 ms / 2,000 ms
コード長 304 bytes
コンパイル時間 231 ms
コンパイル使用メモリ 82,688 KB
実行使用メモリ 100,608 KB
最終ジャッジ日時 2024-04-18 13:02:54
合計ジャッジ時間 3,708 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 37 ms
51,828 KB
testcase_01 AC 35 ms
52,224 KB
testcase_02 AC 34 ms
52,096 KB
testcase_03 AC 36 ms
51,840 KB
testcase_04 AC 38 ms
51,712 KB
testcase_05 AC 74 ms
99,072 KB
testcase_06 AC 75 ms
99,968 KB
testcase_07 AC 75 ms
100,608 KB
testcase_08 AC 69 ms
97,408 KB
testcase_09 AC 68 ms
97,536 KB
testcase_10 AC 70 ms
97,792 KB
testcase_11 AC 75 ms
92,544 KB
testcase_12 AC 79 ms
97,460 KB
testcase_13 AC 47 ms
64,768 KB
testcase_14 AC 53 ms
70,912 KB
testcase_15 AC 72 ms
92,928 KB
testcase_16 AC 69 ms
85,504 KB
testcase_17 AC 44 ms
61,312 KB
testcase_18 AC 46 ms
64,256 KB
testcase_19 AC 54 ms
73,600 KB
testcase_20 AC 72 ms
91,776 KB
testcase_21 AC 53 ms
73,344 KB
testcase_22 AC 55 ms
74,368 KB
testcase_23 AC 47 ms
65,024 KB
testcase_24 AC 61 ms
79,232 KB
testcase_25 AC 64 ms
84,992 KB
testcase_26 AC 60 ms
82,304 KB
testcase_27 AC 74 ms
95,104 KB
testcase_28 AC 60 ms
75,776 KB
testcase_29 AC 47 ms
65,152 KB
testcase_30 AC 46 ms
64,256 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def trans(c):
    if c == "#":
        return 1
    else:
        return 0

N = int(input())
S = list(input())
S = list(map(trans, S))

cnt = 0
ans = 0
for i in range(N - 1, -1, -1):
    if S[i]:
        ans = max(ans, N - i + cnt)
        cnt += 1
    else:
        cnt = max(0, cnt - 1)
print(ans)
    
0