結果

問題 No.379 五円硬貨
コンテスト
ユーザー AyachiGin
提出日時 2016-06-19 21:47:31
言語 Rust
(1.99.0 + proconio + num + itertools + ACL)
コンパイル:
/usr/bin/rustc_custom
実行:
./target/release/main
結果
AC  
実行時間 0 ms / 1,000 ms
+ 822µs
コード長 580 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 1,924 ms
コンパイル使用メモリ 185,956 KB
実行使用メモリ 9,824 KB
最終ジャッジ日時 2026-10-12 04:21:19
合計ジャッジ時間 3,320 ms
ジャッジサーバーID
(参考情報)
judge4_0 / judge3_1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 17
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

use std::io;

fn main() {
    let mut input = String::new();
    io::stdin().read_line(&mut input)
        .expect("Read error");
    let words: Vec<f64> = input.split_whitespace()
        .map(|w| w.parse().unwrap())
        .collect();

    println!("{}", solve(words[0], words[1], words[2]));
}

fn solve(n: f64, g: f64, v: f64) -> f64 {
    let n = n as u64 / 5;
    let n2 = n as f64;

    g  * n2 / v
}

#[test]
fn it_works() {
    assert_eq!(1000.0, solve(100., 500.0, 10.0));
    assert_eq!(335030261.51740766171,
               solve(187456612., 84877661., 9498174.));
}
0