結果

問題 No.2035 Tunnel
ユーザー ntudantuda
提出日時 2022-08-16 22:28:46
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 141 ms / 2,000 ms
コード長 238 bytes
コンパイル時間 122 ms
コンパイル使用メモリ 12,800 KB
実行使用メモリ 22,984 KB
最終ジャッジ日時 2024-04-14 16:05:55
合計ジャッジ時間 3,839 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 30 ms
10,624 KB
testcase_01 AC 31 ms
10,624 KB
testcase_02 AC 30 ms
10,624 KB
testcase_03 AC 30 ms
10,624 KB
testcase_04 AC 30 ms
10,624 KB
testcase_05 AC 139 ms
22,980 KB
testcase_06 AC 138 ms
22,980 KB
testcase_07 AC 134 ms
22,984 KB
testcase_08 AC 85 ms
13,636 KB
testcase_09 AC 134 ms
22,980 KB
testcase_10 AC 135 ms
22,976 KB
testcase_11 AC 118 ms
20,140 KB
testcase_12 AC 141 ms
21,660 KB
testcase_13 AC 40 ms
11,776 KB
testcase_14 AC 58 ms
12,928 KB
testcase_15 AC 113 ms
15,228 KB
testcase_16 AC 100 ms
17,280 KB
testcase_17 AC 32 ms
10,880 KB
testcase_18 AC 38 ms
11,520 KB
testcase_19 AC 64 ms
13,952 KB
testcase_20 AC 118 ms
19,692 KB
testcase_21 AC 70 ms
15,360 KB
testcase_22 AC 72 ms
15,488 KB
testcase_23 AC 46 ms
12,416 KB
testcase_24 AC 84 ms
16,896 KB
testcase_25 AC 100 ms
18,804 KB
testcase_26 AC 96 ms
17,920 KB
testcase_27 AC 128 ms
21,636 KB
testcase_28 AC 75 ms
15,744 KB
testcase_29 AC 47 ms
12,544 KB
testcase_30 AC 43 ms
12,160 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
S = input()

A = [0] * N
i = 0
while S[i] == ".":
    i += 1
S = S[i:]
N = len(S)

for i, s in enumerate(S):
    if s == "#":
        A[i] = A[i - 1] + 1
    else:
        A[i] = A[i - 1] - 1

y = max(A)
print(N + y - 1)
0