結果

問題 No.717 ファッションへのこだわり
ユーザー ixTL255
提出日時 2023-03-24 11:12:22
言語 Rust
(1.83.0 + proconio)
結果
AC  
実行時間 1 ms / 2,000 ms
コード長 455 bytes
コンパイル時間 12,975 ms
コンパイル使用メモリ 387,516 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-09-18 16:01:50
合計ジャッジ時間 13,907 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 10
権限があれば一括ダウンロードができます

ソースコード

diff #

use std::io;

fn read() -> String {
    let mut s = String::new();
    io::stdin().read_line(&mut s).ok();
    s.trim().to_string()
}

fn main() {
    let mut nm = String::new();
    io::stdin().read_line(&mut nm).ok();

    let s = read();
    let t = read();

    println!("{}",
        std::cmp::min(s.match_indices("A").count(), t.match_indices("A").count())
        + std::cmp::min(s.match_indices("B").count(), t.match_indices("B").count())
    );
}
0