結果

問題 No.559 swapAB列
ユーザー shinwisteriashinwisteria
提出日時 2018-03-08 20:25:58
言語 Java21
(openjdk 21)
結果
AC  
実行時間 138 ms / 2,000 ms
コード長 361 bytes
コンパイル時間 4,096 ms
コンパイル使用メモリ 74,856 KB
実行使用メモリ 41,600 KB
最終ジャッジ日時 2024-04-15 12:20:58
合計ジャッジ時間 5,628 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 131 ms
41,600 KB
testcase_01 AC 131 ms
41,352 KB
testcase_02 AC 131 ms
41,336 KB
testcase_03 AC 132 ms
41,156 KB
testcase_04 AC 130 ms
41,208 KB
testcase_05 AC 138 ms
41,212 KB
testcase_06 AC 131 ms
41,468 KB
testcase_07 AC 132 ms
41,572 KB
testcase_08 AC 120 ms
40,000 KB
testcase_09 AC 133 ms
41,512 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

package m.shin;
import java.util.Scanner;
public class Con559 {

	public static void main(String[] args) {
		Scanner s = new Scanner(System.in);
		String str = s.nextLine();
		s.close();

		int count = 0 , b = 0;
		for(int i = 0;i < str.length();i++){
			if(str.charAt(i) == 'A'){
				count += b;
			}else{
				b++;
			}
		}
		System.out.println(count);

	}

}
0