結果
問題 |
No.419 直角三角形
|
ユーザー |
![]() |
提出日時 | 2016-09-10 01:16:27 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 2 ms / 1,000 ms |
コード長 | 382 bytes |
コンパイル時間 | 1,355 ms |
コンパイル使用メモリ | 65,044 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-11-16 19:14:48 |
合計ジャッジ時間 | 1,436 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 20 |
ソースコード
#include<iostream> #include <math.h> #include <string> #include <iomanip> using namespace std; int main(){ double a, b; double answer; cin >> a >> b ; if (a > b){ answer = sqrt(a*a - b*b); printf("%.10f\n", answer); } else if (a < b){ answer = sqrt(b*b - a*a); printf("%.10f\n", answer); }else{ answer = a*sqrt(2); printf("%.10f\n", answer); } return 0; }