結果
| 問題 | 
                            No.559 swapAB列
                             | 
                    
| コンテスト | |
| ユーザー | 
                             maasin
                         | 
                    
| 提出日時 | 2017-11-10 01:52:11 | 
| 言語 | Python3  (3.13.1 + numpy 2.2.1 + scipy 1.14.1)  | 
                    
| 結果 | 
                             
                                AC
                                 
                             
                            
                         | 
                    
| 実行時間 | 31 ms / 2,000 ms | 
| コード長 | 212 bytes | 
| コンパイル時間 | 431 ms | 
| コンパイル使用メモリ | 12,544 KB | 
| 実行使用メモリ | 10,496 KB | 
| 最終ジャッジ日時 | 2024-11-24 08:19:18 | 
| 合計ジャッジ時間 | 1,145 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge2 / judge4 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 3 | 
| other | AC * 7 | 
ソースコード
# 入力
s = input()
count = 0
while s.find('BA') != -1:
    x = s.find('BA')
    s_list = list(s)
    s_list[x] = 'A'
    s_list[x+1] = 'B'
    s = "".join(s_list)
    count += 1
print(count)
            
            
            
        
            
maasin