結果
| 問題 |
No.419 直角三角形
|
| コンテスト | |
| ユーザー |
dgd1724
|
| 提出日時 | 2016-11-07 19:16:49 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 670 bytes |
| コンパイル時間 | 1,906 ms |
| コンパイル使用メモリ | 159,372 KB |
| 実行使用メモリ | 6,824 KB |
| 最終ジャッジ日時 | 2024-11-25 04:20:56 |
| 合計ジャッジ時間 | 2,270 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 17 WA * 3 |
ソースコード
#include <bits/stdc++.h>
//const static double de_PI = 3.14159265358979323846;
//const static int de_MOD = 1000000007;
//const static int de_MAX = 999999999;
//const static int de_MIN = -999999999;
int main(void) {
//std::ifstream inf("123.txt"); std::cin.rdbuf(inf.rdbuf());
double a = 0, b = 0;
std::cin >> a >> b;
double ans1 = std::sqrt(a*a + b*b);
double ans2 = 0;
if (a != b) {
if (a < b) { ans2 = std::sqrt(b*b - a*a); }
else { ans2 = std::sqrt(a*a - b*b); }
}
if (ans1 > ans2) {
std::cout << std::fixed << std::setprecision(10) << ans2 << std::endl;
}
else {
std::cout << std::fixed << std::setprecision(10) << ans1 << std::endl;
}
}
dgd1724