結果
| 問題 |
No.419 直角三角形
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2016-10-14 11:33:29 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 393 bytes |
| コンパイル時間 | 522 ms |
| コンパイル使用メモリ | 66,192 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-11-22 05:59:39 |
| 合計ジャッジ時間 | 1,331 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 17 WA * 3 |
ソースコード
#include <iostream>
#include <cstdint>
#include <cmath>
#include <iomanip>
using namespace std;
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
int a, b;
cin >> a >> b;
double ans1, ans2;
ans1 = sqrt(a * a + b * b);
ans2 = a > b ? sqrt(a * a - b * b) : sqrt(b * b - a * a);
cout << fixed << setprecision(6) << ((ans1 < ans2) ? ans1 : ans2) << endl;
return 0;
}