結果
問題 | No.419 直角三角形 |
ユーザー |
![]() |
提出日時 | 2016-09-09 22:33:35 |
言語 | C++11 (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 2 ms / 1,000 ms |
コード長 | 428 bytes |
コンパイル時間 | 725 ms |
コンパイル使用メモリ | 72,220 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-11-16 10:27:33 |
合計ジャッジ時間 | 1,264 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 20 |
ソースコード
#include<iostream>#include<string>#include<vector>#include<math.h>#include<iomanip>#include<algorithm>using namespace std;int main() {int a, b,temp;double ans;cin >> a >> b;if (a == b) {ans = a*pow(2, 0.5);cout << fixed << setprecision(9) << ans << endl;return 0;}temp = max(a, b)*max(a, b) - min(a, b)*min(a, b);ans = pow(temp, 0.5);cout << fixed << setprecision(9) << ans << endl;return 0;}