結果
問題 |
No.419 直角三角形
|
ユーザー |
|
提出日時 | 2017-10-26 16:10:12 |
言語 | D (dmd 2.109.1) |
結果 |
AC
|
実行時間 | 2 ms / 1,000 ms |
コード長 | 306 bytes |
コンパイル時間 | 2,958 ms |
コンパイル使用メモリ | 153,740 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-06-12 22:08:57 |
合計ジャッジ時間 | 3,437 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 20 |
ソースコード
import std.algorithm, std.conv, std.range, std.stdio, std.string; import std.math; // math functions void main() { auto rd = readln.split.to!(real[]), a = rd[0], b = rd[1]; real c; if (a != b) c = (a ^^ 2 - b ^^ 2).abs.sqrt; else c = (a ^^ 2 + b ^^ 2).sqrt; writefln("%.7f", c); }