結果

問題 No.2021 Not A but B
ユーザー pluto77pluto77
提出日時 2023-01-17 13:09:06
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 139 ms / 2,000 ms
コード長 153 bytes
コンパイル時間 253 ms
コンパイル使用メモリ 10,584 KB
実行使用メモリ 8,516 KB
最終ジャッジ日時 2023-08-30 17:55:49
合計ジャッジ時間 4,337 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 14 ms
7,736 KB
testcase_01 AC 15 ms
7,720 KB
testcase_02 AC 15 ms
7,796 KB
testcase_03 AC 14 ms
7,796 KB
testcase_04 AC 15 ms
7,768 KB
testcase_05 AC 14 ms
7,772 KB
testcase_06 AC 14 ms
7,720 KB
testcase_07 AC 15 ms
7,788 KB
testcase_08 AC 116 ms
8,476 KB
testcase_09 AC 121 ms
8,476 KB
testcase_10 AC 116 ms
8,336 KB
testcase_11 AC 113 ms
8,460 KB
testcase_12 AC 111 ms
8,356 KB
testcase_13 AC 113 ms
8,504 KB
testcase_14 AC 115 ms
8,492 KB
testcase_15 AC 114 ms
8,332 KB
testcase_16 AC 115 ms
8,364 KB
testcase_17 AC 111 ms
8,428 KB
testcase_18 AC 116 ms
8,376 KB
testcase_19 AC 119 ms
8,380 KB
testcase_20 AC 115 ms
8,516 KB
testcase_21 AC 20 ms
7,868 KB
testcase_22 AC 18 ms
7,740 KB
testcase_23 AC 17 ms
7,864 KB
testcase_24 AC 15 ms
7,816 KB
testcase_25 AC 18 ms
7,712 KB
testcase_26 AC 69 ms
8,496 KB
testcase_27 AC 132 ms
8,432 KB
testcase_28 AC 132 ms
8,452 KB
testcase_29 AC 139 ms
8,336 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N=int(input())
S=input()
res=0
if "BB" in S:
 res+=1
for i in range(1,N):
 if S[i-1:i+1] != "BB":
  if i==1 or S[i-2:i+1] != "BAB":
   res+=1
print(res)
0