結果

問題 No.892 タピオカ
ユーザー j0tdj0td
提出日時 2020-03-10 17:58:00
言語 Rust
(1.77.0)
結果
AC  
実行時間 1 ms / 1,000 ms
コード長 493 bytes
コンパイル時間 15,388 ms
コンパイル使用メモリ 383,708 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-04-27 18:46:33
合計ジャッジ時間 16,222 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
6,816 KB
testcase_01 AC 1 ms
6,812 KB
testcase_02 AC 1 ms
6,940 KB
testcase_03 AC 1 ms
6,940 KB
testcase_04 AC 0 ms
6,944 KB
testcase_05 AC 0 ms
6,940 KB
testcase_06 AC 1 ms
6,940 KB
testcase_07 AC 0 ms
6,944 KB
testcase_08 AC 1 ms
6,940 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

fn read_vec<T: std::str::FromStr>() -> Vec<T> {
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).ok();
    s.trim().split_whitespace()
      .map(|e| e.parse().ok().unwrap()).collect()
}
  
fn main() {
    let tapiocas: Vec<u32> = read_vec();
    let (a1, a2, a3) = (tapiocas[0], tapiocas[2], tapiocas[4]);
    
    let odd_count = a1 % 2 + a2 % 2 + a3 % 2;

    if odd_count == 0 || odd_count == 2 {
        println!(":-)");
    } else {
        println!(":-(");
    }
}
0