結果
問題 |
No.2022 Antilogarithm
|
ユーザー |
|
提出日時 | 2022-07-29 21:43:24 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
RE
|
実行時間 | - |
コード長 | 364 bytes |
コンパイル時間 | 91 ms |
コンパイル使用メモリ | 12,544 KB |
実行使用メモリ | 10,752 KB |
最終ジャッジ日時 | 2024-07-19 14:06:23 |
合計ジャッジ時間 | 3,504 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | RE * 3 |
other | RE * 62 |
ソースコード
N = int(input()) S = input() ans = 0 # AA→BB for i in range(N - 1): if S[i:i + 2] == "AA": ans += 1 # A→B for i in range(N): if S[i] == "A": if (0 <= i - 1 and S[i - 1] == "B") or (i + 1 < N and S[i + 1] == "B"): ans += 1 # 不変 for i in range(N - 1): if S[i:i + 2] == "BB": ans += 1 break print(ans)