結果

問題 No.717 ファッションへのこだわり
ユーザー tsunabittsunabit
提出日時 2019-06-26 21:57:52
言語 Java21
(openjdk 21)
結果
AC  
実行時間 205 ms / 2,000 ms
コード長 607 bytes
コンパイル時間 3,183 ms
コンパイル使用メモリ 72,136 KB
実行使用メモリ 58,980 KB
最終ジャッジ日時 2023-09-08 11:40:59
合計ジャッジ時間 6,227 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 132 ms
55,704 KB
testcase_01 AC 121 ms
55,660 KB
testcase_02 AC 122 ms
55,848 KB
testcase_03 AC 122 ms
55,616 KB
testcase_04 AC 126 ms
55,616 KB
testcase_05 AC 132 ms
55,280 KB
testcase_06 AC 162 ms
56,556 KB
testcase_07 AC 190 ms
56,432 KB
testcase_08 AC 199 ms
58,880 KB
testcase_09 AC 205 ms
58,980 KB
testcase_10 AC 179 ms
56,564 KB
testcase_11 AC 187 ms
57,656 KB
testcase_12 AC 185 ms
58,848 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;
import java.io.*;
import java.math.*;

public class No717 {
    public static void main(String[] args) {
    	Scanner sc = new Scanner(System.in);
    	int n = sc.nextInt();
    	int m = sc.nextInt();
    	String s = sc.next();
    	String t = sc.next();
    	int c = 0;
    	c += s.replaceAll("B", "").length() < t.replaceAll("B", "").length()? s.replaceAll("B", "").length() : t.replaceAll("B", "").length();
    	c += s.replaceAll("A", "").length() < t.replaceAll("A", "").length()? s.replaceAll("A", "").length() : t.replaceAll("A", "").length();
    	System.out.println(c);
    }
}
0