結果

問題 No.2021 Not A but B
ユーザー ニックネームニックネーム
提出日時 2022-07-29 21:35:07
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 241 ms / 2,000 ms
コード長 198 bytes
コンパイル時間 251 ms
コンパイル使用メモリ 10,664 KB
実行使用メモリ 41,588 KB
最終ジャッジ日時 2023-09-26 19:33:01
合計ジャッジ時間 4,807 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
7,776 KB
testcase_01 AC 16 ms
7,804 KB
testcase_02 AC 15 ms
7,832 KB
testcase_03 AC 15 ms
7,888 KB
testcase_04 AC 15 ms
7,892 KB
testcase_05 AC 15 ms
7,832 KB
testcase_06 AC 15 ms
7,832 KB
testcase_07 AC 15 ms
7,776 KB
testcase_08 AC 188 ms
24,428 KB
testcase_09 AC 184 ms
24,512 KB
testcase_10 AC 180 ms
24,296 KB
testcase_11 AC 181 ms
23,936 KB
testcase_12 AC 183 ms
24,048 KB
testcase_13 AC 176 ms
24,084 KB
testcase_14 AC 181 ms
24,336 KB
testcase_15 AC 179 ms
24,196 KB
testcase_16 AC 183 ms
24,052 KB
testcase_17 AC 178 ms
23,868 KB
testcase_18 AC 185 ms
24,648 KB
testcase_19 AC 188 ms
24,392 KB
testcase_20 AC 178 ms
24,684 KB
testcase_21 AC 24 ms
9,120 KB
testcase_22 AC 20 ms
8,480 KB
testcase_23 AC 20 ms
8,528 KB
testcase_24 AC 16 ms
7,836 KB
testcase_25 AC 20 ms
8,440 KB
testcase_26 AC 101 ms
8,488 KB
testcase_27 AC 218 ms
35,244 KB
testcase_28 AC 213 ms
35,200 KB
testcase_29 AC 241 ms
41,588 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
s = input()
ans = set()
for i in range(n-1):
    change = []
    if s[i] != "B": change.append(i)
    if s[i+1] != "B": change.append(i+1)
    ans.add(tuple(change))
print(len(ans))
0