結果

問題 No.419 直角三角形
ユーザー toshiro_yanagitoshiro_yanagi
提出日時 2018-08-26 11:44:15
言語 Nim
(2.2.0)
結果
AC  
実行時間 2 ms / 1,000 ms
コード長 223 bytes
コンパイル時間 3,516 ms
コンパイル使用メモリ 66,216 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-07-01 03:54:13
合計ジャッジ時間 4,309 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 20
権限があれば一括ダウンロードができます

ソースコード

diff #

import strutils, sequtils, math

let
  tmp = map(split readLine stdin, parseInt)
  (a, b) = (tmp[0], tmp[1])
  r = max(a, b)
  x = min(a, b)

if a != b:
  echo sqrt(float(r ^ 2 - x ^ 2))
else:
  echo sqrt(float(2 * a ^ 2))
0