結果

問題 No.892 タピオカ
ユーザー j0td
提出日時 2020-03-10 17:58:00
言語 Rust
(1.83.0 + proconio)
結果
AC  
実行時間 1 ms / 1,000 ms
コード長 493 bytes
コンパイル時間 24,304 ms
コンパイル使用メモリ 379,920 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-11-15 23:31:36
合計ジャッジ時間 24,740 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 6
権限があれば一括ダウンロードができます

ソースコード

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