結果

問題 No.717 ファッションへのこだわり
ユーザー tsunabit
提出日時 2019-06-26 21:57:52
言語 Java
(openjdk 23)
結果
AC  
実行時間 205 ms / 2,000 ms
コード長 607 bytes
コンパイル時間 3,577 ms
コンパイル使用メモリ 74,712 KB
実行使用メモリ 43,312 KB
最終ジャッジ日時 2024-06-26 04:56:34
合計ジャッジ時間 6,452 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 10
権限があれば一括ダウンロードができます

ソースコード

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