結果

問題 No.2021 Not A but B
ユーザー shobonvipshobonvip
提出日時 2022-07-29 21:39:47
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 124 ms / 2,000 ms
コード長 237 bytes
コンパイル時間 282 ms
コンパイル使用メモリ 86,884 KB
実行使用メモリ 97,424 KB
最終ジャッジ日時 2023-09-26 20:04:47
合計ジャッジ時間 4,525 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 75 ms
71,308 KB
testcase_01 AC 70 ms
71,256 KB
testcase_02 AC 73 ms
71,248 KB
testcase_03 AC 75 ms
71,208 KB
testcase_04 AC 71 ms
71,308 KB
testcase_05 AC 70 ms
71,232 KB
testcase_06 AC 69 ms
71,104 KB
testcase_07 AC 70 ms
71,468 KB
testcase_08 AC 114 ms
91,508 KB
testcase_09 AC 110 ms
90,636 KB
testcase_10 AC 114 ms
89,580 KB
testcase_11 AC 112 ms
89,548 KB
testcase_12 AC 113 ms
90,540 KB
testcase_13 AC 113 ms
90,616 KB
testcase_14 AC 116 ms
90,464 KB
testcase_15 AC 116 ms
90,440 KB
testcase_16 AC 114 ms
89,516 KB
testcase_17 AC 112 ms
89,472 KB
testcase_18 AC 115 ms
90,840 KB
testcase_19 AC 118 ms
91,396 KB
testcase_20 AC 115 ms
91,448 KB
testcase_21 AC 89 ms
76,368 KB
testcase_22 AC 87 ms
76,216 KB
testcase_23 AC 91 ms
76,432 KB
testcase_24 AC 81 ms
76,300 KB
testcase_25 AC 90 ms
76,280 KB
testcase_26 AC 83 ms
76,316 KB
testcase_27 AC 124 ms
96,908 KB
testcase_28 AC 123 ms
97,000 KB
testcase_29 AC 118 ms
97,424 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
s = input()

mask = 10000000
w = set()
for i in range(n-1):
	tmp = []
	if s[i] == "A":
		tmp.append(i+1)
	if s[i+1] == "A":
		tmp.append(i+2)
	v = 1
	l = 0
	for j in tmp:
		l += v * j
		v *= mask
	w.add(l)

print(len(w))
0