結果

問題 No.419 直角三角形
ユーザー kyo1
提出日時 2020-07-10 00:26:48
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 1,000 ms
コード長 300 bytes
コンパイル時間 2,048 ms
コンパイル使用メモリ 191,460 KB
最終ジャッジ日時 2025-01-11 17:17:49
ジャッジサーバーID
(参考情報)
judge3 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 20
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>

using namespace std;

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int a, b;
  cin >> a >> b;
  cout << fixed << setprecision(10);
  if (a == b) {
    cout << sqrt(a * a * 2) << '\n';
  } else {
    cout << sqrt(abs(a * a - b * b)) << '\n';
  }
  return 0;
}
0