結果

問題 No.419 直角三角形
ユーザー yaki
提出日時 2022-08-08 10:18:47
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 392 bytes
コンパイル時間 1,593 ms
コンパイル使用メモリ 164,640 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-09-18 21:10:56
合計ジャッジ時間 2,424 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 18 WA * 2
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;

int main()
{
    double a, b;
    cin >> a >> b;
    double l, s;
    if (a > b)
    {
        s = b;
        l = a;
    }
    else if (a < b)
    {
        s = a;
        l = b;
    }
    else
    {
        cout << pow(2, 0.5) * a;
        return 0;
    }
    double ans = sqrtf64(pow(l, 2) - pow(s, 2));
    cout << setprecision(15) << ans;
}
0