結果

問題 No.419 直角三角形
ユーザー snrnsidy
提出日時 2021-09-19 01:10:48
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 3 ms / 1,000 ms
コード長 419 bytes
コンパイル時間 2,178 ms
コンパイル使用メモリ 191,968 KB
最終ジャッジ日時 2025-01-24 15:50:15
ジャッジサーバーID
(参考情報)
judge3 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 20
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>

using namespace std;

int main(void)
{
    cin.tie(0);
    ios::sync_with_stdio(false);

    int a,b;

    cin >> a >> b;

    int A = min(a,b);
    int B = max(a,b);

    double c = sqrt(B*B - A*A);
    double d = sqrt(B*B + A*A);

    cout << fixed;
    cout.precision(16);

    if(a==b)
    {
        cout << d << '\n';
    }
    else
    {
        cout << c << '\n';
    }

    return 0;
}
0