結果

問題 No.2050 Speed
コンテスト
ユーザー yuzu32ut
提出日時 2022-10-07 18:07:07
言語 Rust
(1.93.0 + proconio + num + itertools)
コンパイル:
/usr/bin/rustc_custom
実行:
./target/release/main
結果
AC  
実行時間 1 ms / 2,000 ms
コード長 1,086 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 882 ms
コンパイル使用メモリ 200,992 KB
実行使用メモリ 7,716 KB
最終ジャッジ日時 2026-03-05 05:16:44
合計ジャッジ時間 1,753 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 15
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#[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): (f64, f64) = (a as f64, ((b * 3600) as f64) / 1000.0);
    dbg!(a, b);

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

    Ok(())
}
0