結果
問題 | No.419 直角三角形 |
ユーザー |
![]() |
提出日時 | 2018-07-30 13:51:14 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 1,000 ms |
コード長 | 492 bytes |
コンパイル時間 | 1,514 ms |
コンパイル使用メモリ | 166,776 KB |
実行使用メモリ | 6,948 KB |
最終ジャッジ日時 | 2024-09-13 19:27:27 |
合計ジャッジ時間 | 2,353 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 20 |
ソースコード
#include<bits/stdc++.h> using namespace std; using Int = long long; template<typename T1,typename T2> inline void chmin(T1 &a,T2 b){if(a>b) a=b;} template<typename T1,typename T2> inline void chmax(T1 &a,T2 b){if(a<b) a=b;} struct Precision{ Precision(){ cout<<fixed<<setprecision(12); } }precision_beet; //INSERT ABOVE HERE signed main(){ double a,b; cin>>a>>b; double c=sqrt(a*a+b*b); if(a>b) swap(a,b); if(a!=b) chmin(c,sqrt(b*b-a*a)); cout<<c<<endl; return 0; }