結果

問題 No.2021 Not A but B
ユーザー 👑 rin204rin204
提出日時 2022-08-21 06:30:06
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 266 bytes
コンパイル時間 365 ms
コンパイル使用メモリ 82,304 KB
実行使用メモリ 93,920 KB
最終ジャッジ日時 2024-04-18 03:41:17
合計ジャッジ時間 3,492 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 AC 38 ms
51,840 KB
testcase_03 WA -
testcase_04 AC 38 ms
51,840 KB
testcase_05 AC 38 ms
52,352 KB
testcase_06 AC 38 ms
51,968 KB
testcase_07 AC 37 ms
51,968 KB
testcase_08 WA -
testcase_09 WA -
testcase_10 AC 86 ms
87,192 KB
testcase_11 WA -
testcase_12 WA -
testcase_13 AC 86 ms
87,284 KB
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 AC 88 ms
87,456 KB
testcase_20 AC 89 ms
87,288 KB
testcase_21 AC 55 ms
64,640 KB
testcase_22 AC 52 ms
63,872 KB
testcase_23 AC 53 ms
64,384 KB
testcase_24 AC 45 ms
59,392 KB
testcase_25 AC 53 ms
64,000 KB
testcase_26 AC 48 ms
63,968 KB
testcase_27 AC 93 ms
93,856 KB
testcase_28 AC 93 ms
93,676 KB
testcase_29 AC 88 ms
93,920 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
        tot += l
    
    se.add(tot)
print(len(se))
0