結果

問題 No.2050 Speed
ユーザー yuzu32ut
提出日時 2022-10-07 18:04:34
言語 Rust
(1.83.0 + proconio)
結果
WA  
実行時間 -
コード長 1,070 bytes
コンパイル時間 13,465 ms
コンパイル使用メモリ 378,624 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-06-12 00:58:21
合計ジャッジ時間 14,628 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 14 WA * 1
権限があれば一括ダウンロードができます

ソースコード

diff #

#[allow(dead_code)]
pub mod nayuta {
    use std::{error, io, result};
    pub type Result<T> = result::Result<T, Box<dyn error::Error>>;

    fn input_string_line() -> Result<String> {
        let mut s: String = String::new();
        io::stdin().read_line(&mut s)?;
        Ok(s.trim().into())
    }

    fn input_values() -> Result<Vec<usize>> {
        let s: String = input_string_line()?;
        let v: Vec<usize> = s
            .split_ascii_whitespace()
            .map(|x: &str| x.parse::<usize>().map_err(|e| e.into()))
            .collect::<Result<_>>()?;
        Ok(v)
    }

    pub fn input_two_tuple() -> Result<(usize, usize)> {
        let v: Vec<usize> = input_values()?;
        Ok((v[0], v[1]))
    }
}

fn main() -> nayuta::Result<()> {
    let (a, b): (usize, usize) = nayuta::input_two_tuple()?;
    let (a, b): (f32, f32) = (a as f32, ((b * 3600) as f32) / 1000.0);

    println!(
        "{}",
        match () {
            _ if a > b => "KoD",
            _ if a < b => "blackyuki",
            _ => "same",
        }
    );

    Ok(())
}
0