結果

問題 No.419 直角三角形
ユーザー data9824
提出日時 2016-10-15 23:12:16
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 2 ms / 1,000 ms
コード長 298 bytes
コンパイル時間 595 ms
コンパイル使用メモリ 68,184 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-11-22 11:52:47
合計ジャッジ時間 1,638 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 20
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <iomanip>
#include <algorithm>
#include <cmath>

using namespace std;

int main() {
	double a, b;
	cin >> a >> b;
	double c1 = abs(b * b - a * a);
	double c2 = a * a + b * b;
	cout << fixed << setprecision(7) << sqrt(c1 == 0.0 ? c2 : min(c1, c2)) << endl;
	return 0;
}
0