結果

問題 No.419 直角三角形
ユーザー ixTL255ixTL255
提出日時 2016-09-10 00:57:36
言語 Scala(Beta)
(3.4.0)
結果
AC  
実行時間 953 ms / 1,000 ms
コード長 246 bytes
コンパイル時間 9,763 ms
コンパイル使用メモリ 259,096 KB
実行使用メモリ 63,732 KB
最終ジャッジ日時 2023-09-12 04:34:33
合計ジャッジ時間 32,367 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 938 ms
62,692 KB
testcase_01 AC 936 ms
62,296 KB
testcase_02 AC 943 ms
62,392 KB
testcase_03 AC 937 ms
63,732 KB
testcase_04 AC 942 ms
62,296 KB
testcase_05 AC 938 ms
62,524 KB
testcase_06 AC 941 ms
62,480 KB
testcase_07 AC 951 ms
62,548 KB
testcase_08 AC 944 ms
62,172 KB
testcase_09 AC 936 ms
62,664 KB
testcase_10 AC 946 ms
62,208 KB
testcase_11 AC 953 ms
62,160 KB
testcase_12 AC 946 ms
63,612 KB
testcase_13 AC 936 ms
62,360 KB
testcase_14 AC 925 ms
62,284 KB
testcase_15 AC 936 ms
62,416 KB
testcase_16 AC 922 ms
62,424 KB
testcase_17 AC 931 ms
63,372 KB
testcase_18 AC 927 ms
62,284 KB
testcase_19 AC 946 ms
62,636 KB
testcase_20 AC 946 ms
62,352 KB
testcase_21 AC 940 ms
62,064 KB
testcase_22 AC 942 ms
62,396 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import scala.io.StdIn.readLine
import scala.math._

object Main extends App {
	val ab = readLine().split(" ").map(_.toInt)
	if(ab(0) == ab(1)){
		println(sqrt(ab(0)*ab(0)+ab(1)*ab(1)))
	}
	else {
		println(sqrt(abs(ab(0)*ab(0)-ab(1)*ab(1))))
	}
}
0