結果

問題 No.419 直角三角形
ユーザー sekihankamibanzsekihankamibanz
提出日時 2018-10-28 10:55:09
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 530 ms / 1,000 ms
コード長 216 bytes
コンパイル時間 104 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 43,932 KB
最終ジャッジ日時 2024-04-29 22:23:53
合計ジャッジ時間 13,560 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 522 ms
43,668 KB
testcase_01 AC 520 ms
43,676 KB
testcase_02 AC 516 ms
43,544 KB
testcase_03 AC 523 ms
43,548 KB
testcase_04 AC 521 ms
43,672 KB
testcase_05 AC 524 ms
43,420 KB
testcase_06 AC 523 ms
43,672 KB
testcase_07 AC 520 ms
43,420 KB
testcase_08 AC 516 ms
43,412 KB
testcase_09 AC 514 ms
43,932 KB
testcase_10 AC 519 ms
43,668 KB
testcase_11 AC 527 ms
43,688 KB
testcase_12 AC 521 ms
43,656 KB
testcase_13 AC 530 ms
43,416 KB
testcase_14 AC 527 ms
43,548 KB
testcase_15 AC 521 ms
43,680 KB
testcase_16 AC 527 ms
43,804 KB
testcase_17 AC 528 ms
43,672 KB
testcase_18 AC 521 ms
43,420 KB
testcase_19 AC 516 ms
43,416 KB
testcase_20 AC 520 ms
43,672 KB
testcase_21 AC 524 ms
43,652 KB
testcase_22 AC 527 ms
43,664 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import numpy as np


a, b = [int(x) for x in input().split(' ')]
if b > a:
    a, b = b, a

if a != b:
    c = np.sqrt(np.array([a ** 2 - b ** 2]))

else:
    c = np.sqrt(np.array([a ** 2 + b ** 2]))
    
print(c[0])
0