結果
問題 | No.419 直角三角形 |
ユーザー |
|
提出日時 | 2018-11-22 01:50:09 |
言語 | C++11 (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 2 ms / 1,000 ms |
コード長 | 375 bytes |
コンパイル時間 | 666 ms |
コンパイル使用メモリ | 66,716 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-12-24 16:13:08 |
合計ジャッジ時間 | 1,588 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 20 |
ソースコード
#include<iostream>#include<string>#include<math.h>#include<iomanip>using namespace std;int main() {double a, b;cin >> a >> b;if (a > b)cout <<fixed<<setprecision(10)<< sqrt(pow(a, 2) - pow(b,2))<<endl;else if (a < b)cout <<fixed<<setprecision(10)<< sqrt(pow(b,2)-pow(a,2))<<endl;else cout << fixed << setprecision(10) << a * sqrt(2) << endl;return 0;}