結果

問題 No.419 直角三角形
ユーザー Mcpu3Mcpu3
提出日時 2018-05-03 23:23:52
言語 C
(gcc 13.3.0)
結果
AC  
実行時間 1 ms / 1,000 ms
コード長 249 bytes
コンパイル時間 216 ms
コンパイル使用メモリ 30,464 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-06-28 00:53:45
合計ジャッジ時間 898 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 20
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <stdio.h>
#include <math.h>

int main(void)
{
	float a, b, c, d;
	scanf("%f%f", &a, &b);
	c = a * a - b * b;
	d = b * b - a * a;
	printf("%.7f\n", a != b ? sqrt(c) < sqrt(d) ? sqrt(fabs(c)) : sqrt(fabs(d)) : sqrt(a*b + a * b));
	return 0;
}
0