結果
問題 | No.419 直角三角形 |
ユーザー |
|
提出日時 | 2020-05-30 21:20:03 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 3 ms / 1,000 ms |
コード長 | 511 bytes |
コンパイル時間 | 1,551 ms |
コンパイル使用メモリ | 167,872 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-11-08 04:02:45 |
合計ジャッジ時間 | 2,519 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 20 |
ソースコード
#include <bits/stdc++.h>using namespace std;#define REP(i,n) for(int i=0; i<(int)(n); i++)#define FOR(i,b,e) for (int i=(int)(b); i<(int)(e); i++)#define ALL(x) (x).begin(), (x).end()const double PI = acos(-1);int main() {ios_base::sync_with_stdio(0);cin.tie(0);double a, b;cin >> a >> b;double c = 0.0;if (a == b) {c = sqrt(a*a + b*b);} else {if (a < b)swap(a, b);c = sqrt(a*a - b*b);}cout << fixed << setprecision(9) << c << endl;return 0;}