結果

問題 No.1230 Hall_and_me
ユーザー どらら
提出日時 2020-09-21 01:23:03
言語 Rust
(1.83.0 + proconio)
結果
AC  
実行時間 1 ms / 2,000 ms
コード長 478 bytes
コンパイル時間 12,359 ms
コンパイル使用メモリ 392,872 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-06-24 11:18:57
合計ジャッジ時間 13,914 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 36
権限があれば一括ダウンロードができます

ソースコード

diff #

use std::cmp;
use std::io::*;
use std::str::FromStr;

fn calc(p: i32, q: i32, r: i32) -> f64 {
    let mn = cmp::min(p, cmp::min(q, r)) as f64;
    let sum = (p + q + r) as f64;

    1.0 - mn / sum
}

fn main() {
    let mut s = String::new();
    stdin().read_line(&mut s).ok();
    let mut it = s.split_whitespace().map(|n| i32::from_str(n).unwrap());
    let (p, q, r) = (it.next().unwrap(), it.next().unwrap(), it.next().unwrap());

    println!("{:.12}", calc(p, q, r));
}
0