結果
| 問題 |
No.419 直角三角形
|
| コンテスト | |
| ユーザー |
cra77756176
|
| 提出日時 | 2022-12-13 20:26:16 |
| 言語 | Rust (1.83.0 + proconio) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 1,000 ms |
| コード長 | 428 bytes |
| コンパイル時間 | 14,633 ms |
| コンパイル使用メモリ | 379,168 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-11-07 14:34:37 |
| 合計ジャッジ時間 | 15,937 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 20 |
ソースコード
fn main() {
let mut xx = String::new();
std::io::stdin().read_line(&mut xx).ok();
let xx: Vec<&str> = xx.split_whitespace().collect();
let mut ff: Vec<f64> = xx.clone().into_iter().flat_map(str::parse).collect();
if xx[0] == xx[1] {
println!("{}", ff[0].hypot(ff[0]));
} else {
ff.sort_unstable_by(f64::total_cmp);
println!("{}", (ff[1].powi(2) - ff[0].powi(2)).sqrt());
}
}
cra77756176