結果

問題 No.419 直角三角形
ユーザー 👑 CleyL
提出日時 2020-01-29 18:33:07
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 1,000 ms
コード長 286 bytes
コンパイル時間 689 ms
コンパイル使用メモリ 73,456 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-09-16 01:51:11
合計ジャッジ時間 1,355 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 20
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <cmath>
#include <iomanip>
using namespace std;
int main(){
    cout << fixed << setprecision(10);
    int a,b;cin>>a>>b;
    if(a==b){
        cout << sqrt(a*a+b*b) << endl;
        return 0;
    }else if(a<b)swap(a,b);
    cout << sqrt(a*a-b*b) << endl;
}
0