結果
| 問題 | No.1179 Quadratic Equation |
| コンテスト | |
| ユーザー |
Strorkis
|
| 提出日時 | 2020-08-21 22:15:31 |
| 言語 | Rust (1.83.0 + proconio) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 782 bytes |
| コンパイル時間 | 12,106 ms |
| コンパイル使用メモリ | 402,300 KB |
| 実行使用メモリ | 6,820 KB |
| 最終ジャッジ日時 | 2024-10-15 05:47:17 |
| 合計ジャッジ時間 | 12,473 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 9 WA * 2 |
ソースコード
fn main() {
let (a, b, c): (i32, i32, i32) = {
let mut buf = String::new();
std::io::stdin().read_line(&mut buf).unwrap();
let mut iter = buf.split_whitespace();
(
iter.next().unwrap().parse().unwrap(),
iter.next().unwrap().parse().unwrap(),
iter.next().unwrap().parse().unwrap(),
)
};
let d = b * b - 4 * a * c;
if d > 0 {
println!(
"{:.10} {:.10}",
(-(b as f64) - (d as f64).sqrt()) / (2.0 * (a as f64)),
(-(b as f64) + (d as f64).sqrt()) / (2.0 * (a as f64)),
)
} else if d == 0 {
println!(
"{:.10}",
(-(b as f64) / (2.0 * (a as f64))),
)
} else {
println!("imaginary");
}
}
Strorkis