結果

問題 No.419 直角三角形
ユーザー lam6er
提出日時 2025-03-20 18:40:40
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 1,000 ms
コード長 292 bytes
コンパイル時間 1,888 ms
コンパイル使用メモリ 193,108 KB
実行使用メモリ 7,324 KB
最終ジャッジ日時 2025-03-20 18:40:48
合計ジャッジ時間 2,550 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 20
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
int main() {
  cin.tie(0)->sync_with_stdio(0);
  int n, m;
  cin >> n >> m;
  cout << fixed << setprecision(15);
  if (n == m) {
    cout << sqrt(2) * n << endl;
  } else {
    if (n > m) swap(n, m);
    cout << sqrt(m * m - n * n) << endl;
  }
}
0