結果

問題 No.2035 Tunnel
ユーザー 👑 H20H20
提出日時 2022-08-12 21:41:19
言語 PyPy3
(7.3.13)
結果
AC  
実行時間 80 ms / 2,000 ms
コード長 237 bytes
コンパイル時間 170 ms
コンパイル使用メモリ 81,808 KB
実行使用メモリ 91,956 KB
最終ジャッジ日時 2023-10-24 08:57:43
合計ジャッジ時間 3,034 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 39 ms
53,428 KB
testcase_01 AC 39 ms
53,428 KB
testcase_02 AC 37 ms
53,428 KB
testcase_03 AC 37 ms
53,428 KB
testcase_04 AC 36 ms
53,428 KB
testcase_05 AC 73 ms
91,884 KB
testcase_06 AC 75 ms
91,896 KB
testcase_07 AC 74 ms
91,956 KB
testcase_08 AC 71 ms
91,576 KB
testcase_09 AC 55 ms
77,508 KB
testcase_10 AC 56 ms
77,332 KB
testcase_11 AC 72 ms
88,152 KB
testcase_12 AC 80 ms
91,088 KB
testcase_13 AC 50 ms
62,336 KB
testcase_14 AC 48 ms
67,568 KB
testcase_15 AC 73 ms
89,172 KB
testcase_16 AC 56 ms
76,740 KB
testcase_17 AC 41 ms
59,604 KB
testcase_18 AC 46 ms
62,168 KB
testcase_19 AC 56 ms
70,052 KB
testcase_20 AC 72 ms
88,368 KB
testcase_21 AC 48 ms
68,332 KB
testcase_22 AC 51 ms
70,472 KB
testcase_23 AC 44 ms
62,644 KB
testcase_24 AC 51 ms
73,712 KB
testcase_25 AC 53 ms
76,852 KB
testcase_26 AC 53 ms
76,488 KB
testcase_27 AC 75 ms
89,980 KB
testcase_28 AC 50 ms
70,632 KB
testcase_29 AC 42 ms
62,700 KB
testcase_30 AC 44 ms
62,488 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
A = list(input())[::-1]#混乱するから逆にする
ans=0
nowKeep = 0
for i,a in enumerate(A,start=1):
    if a=='#':
        ans = nowKeep+i
        nowKeep+=1
    else:
        nowKeep=max(0,nowKeep-1)
print(ans)


0