結果
問題 |
No.419 直角三角形
|
ユーザー |
![]() |
提出日時 | 2021-03-09 21:41:51 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 1,000 ms |
コード長 | 719 bytes |
コンパイル時間 | 1,106 ms |
コンパイル使用メモリ | 89,408 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-10-11 12:36:40 |
合計ジャッジ時間 | 1,623 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 20 |
ソースコード
#include <iostream> #include <vector> #include <algorithm> #include <stdio.h> #include <iomanip> #include <map> #include <set> #include <math.h> using namespace std; #define rep(i,n) for(int i = 0; i < (n); i++) typedef long long ll; typedef long double lld; const int MOD = 1000000007; const lld PI = 3.14159265358979; double f (double a , double b) { if (a > b) return b; else return a; } int main () { cout << fixed << setprecision(15); double a , b; cin >> a >> b; if (a == b) { double ans = a * a + b * b; cout << sqrt(ans) << endl; return 0; } if (a < b)swap(a , b); double ans = a * a - b * b; cout << sqrt(ans) << endl; return 0; }