結果

問題 No.2021 Not A but B
ユーザー 👑 rin204rin204
提出日時 2022-08-21 06:30:54
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 89 ms / 2,000 ms
コード長 269 bytes
コンパイル時間 461 ms
コンパイル使用メモリ 82,456 KB
実行使用メモリ 94,328 KB
最終ジャッジ日時 2024-04-18 04:06:12
合計ジャッジ時間 4,676 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 35 ms
52,944 KB
testcase_01 AC 35 ms
52,524 KB
testcase_02 AC 36 ms
51,816 KB
testcase_03 AC 35 ms
52,276 KB
testcase_04 AC 35 ms
52,728 KB
testcase_05 AC 37 ms
52,940 KB
testcase_06 AC 36 ms
53,376 KB
testcase_07 AC 36 ms
52,760 KB
testcase_08 AC 82 ms
87,260 KB
testcase_09 AC 86 ms
87,276 KB
testcase_10 AC 81 ms
86,908 KB
testcase_11 AC 79 ms
87,316 KB
testcase_12 AC 81 ms
87,324 KB
testcase_13 AC 80 ms
87,400 KB
testcase_14 AC 81 ms
87,328 KB
testcase_15 AC 79 ms
87,016 KB
testcase_16 AC 80 ms
87,312 KB
testcase_17 AC 79 ms
87,296 KB
testcase_18 AC 82 ms
87,148 KB
testcase_19 AC 84 ms
87,084 KB
testcase_20 AC 81 ms
87,152 KB
testcase_21 AC 51 ms
65,716 KB
testcase_22 AC 49 ms
65,144 KB
testcase_23 AC 50 ms
64,940 KB
testcase_24 AC 41 ms
61,308 KB
testcase_25 AC 51 ms
64,212 KB
testcase_26 AC 45 ms
64,512 KB
testcase_27 AC 89 ms
94,132 KB
testcase_28 AC 88 ms
94,328 KB
testcase_29 AC 87 ms
93,864 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
S = input()
se = set()
for i in range(1, n):
    lst = []
    if S[i - 1] == "A":
        lst.append(i - 1)
    if S[i] == "A":
        lst.append(i)
    tot = 0
    for l in lst:
        tot *= n + 1
        tot += l + 1
    se.add(tot)
print(len(se))
0