結果
問題 | No.2021 Not A but B |
ユーザー |
👑 |
提出日時 | 2022-08-21 06:30:54 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 92 ms / 2,000 ms |
コード長 | 269 bytes |
コンパイル時間 | 823 ms |
コンパイル使用メモリ | 82,304 KB |
実行使用メモリ | 93,804 KB |
最終ジャッジ日時 | 2024-10-09 21:39:11 |
合計ジャッジ時間 | 3,885 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 26 |
ソースコード
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 = 0for l in lst:tot *= n + 1tot += l + 1se.add(tot)print(len(se))