結果

問題 No.2920 Blood Type
ユーザー 👑 loop0919
提出日時 2024-09-25 09:35:45
言語 Rust
(1.83.0 + proconio)
結果
AC  
実行時間 1 ms / 2,000 ms
コード長 588 bytes
コンパイル時間 12,873 ms
コンパイル使用メモリ 381,376 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-09-25 09:36:02
合計ジャッジ時間 14,099 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 36
権限があれば一括ダウンロードができます

ソースコード

diff #

use proconio::input;

fn main() {
    input! {
        s_str: String,
        t_str: String,
    };

    let mut a = 0;
    let mut b = 0;
    let mut ab = 0;
    let mut o = 0;

    for s in s_str.chars() {
        for t in t_str.chars() {
            let st_vec = vec![s, t];
            match (st_vec.contains(&'A'), st_vec.contains(&'B')) {
                (true, false) => a += 25,
                (false, true) => b += 25,
                (true, true) => ab += 25,
                (false, false) => o += 25,
            }
        }
    }
    println!("{} {} {} {}", a, b, ab, o);
}
0