結果

問題 No.2920 Blood Type
ユーザー tnodino
提出日時 2024-06-16 07:32:32
言語 Rust
(1.83.0 + proconio)
結果
AC  
実行時間 1 ms / 2,000 ms
コード長 696 bytes
コンパイル時間 16,305 ms
コンパイル使用メモリ 385,408 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-06-16 07:32:50
合計ジャッジ時間 17,564 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 36
権限があれば一括ダウンロードができます

ソースコード

diff #

use proconio::input;
use proconio::fastout;
use proconio::marker::Chars;

fn f(x: char, y: char) -> usize {
    if (x == 'A' && y == 'B') || (x == 'B' && y == 'A') {
        return 2;
    }
    else if x == 'A' || y == 'A' {
        return 0;
    }
    else if x == 'B' || y == 'B' {
        return 1;
    }
    else {
        return 3;
    }
}

#[fastout]
#[allow(non_snake_case)]
fn main() {
    input! {
        S: Chars,
        T: Chars,
    }
    let mut ans = vec![0; 4];
    for i in 0..2 {
        for j in 0..2 {
            let idx = f(S[i], T[j]);
            ans[idx] += 25;
        }
    }
    println!("{}", ans.iter().map(|&x| x.to_string()).collect::<Vec<String>>().join(" "));
}
0