結果
| 問題 |
No.1230 Hall_and_me
|
| コンテスト | |
| ユーザー |
どらら
|
| 提出日時 | 2020-09-21 01:22:35 |
| 言語 | Rust (1.83.0 + proconio) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 547 bytes |
| コンパイル時間 | 13,464 ms |
| コンパイル使用メモリ | 401,712 KB |
| 実行使用メモリ | 6,940 KB |
| 最終ジャッジ日時 | 2024-06-24 11:18:43 |
| 合計ジャッジ時間 | 14,864 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 35 WA * 1 |
ソースコード
use std::cmp;
use std::io::*;
use std::str::FromStr;
fn calc(p: i32, q: i32, r: i32) -> f64 {
if p == 100 || q == 100 || r == 100 {
return 1.0;
}
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));
}
どらら