結果
| 問題 |
No.419 直角三角形
|
| コンテスト | |
| ユーザー |
gigime
|
| 提出日時 | 2016-09-09 22:36:15 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 1,000 ms |
| コード長 | 453 bytes |
| コンパイル時間 | 1,582 ms |
| コンパイル使用メモリ | 157,788 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-11-16 10:29:19 |
| 合計ジャッジ時間 | 2,257 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 20 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
#define FOR(i,l,r) for(int i = (l);i < (r);i++)
#define PB push_back
#define MP make_pair
#define ALL(x) (x).begin(),(x).end()
typedef long long ll;
double A,B;
int main()
{
cin >> A >> B;
cout << fixed << setprecision(10);
if(A > B){
cout << sqrt(A * A - B * B) << endl;
}
else if(A == B){
cout << sqrt(A * A + B * B) << endl;
}
else{
cout << sqrt(B * B - A * A) << endl;
}
return 0;
}
gigime