結果
問題 |
No.419 直角三角形
|
ユーザー |
|
提出日時 | 2016-10-14 11:31:30 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 393 bytes |
コンパイル時間 | 642 ms |
コンパイル使用メモリ | 66,192 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-11-22 05:59:38 |
合計ジャッジ時間 | 1,572 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | WA * 3 |
other | AC * 3 WA * 17 |
ソースコード
#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; }