結果
問題 | No.419 直角三角形 |
ユーザー |
![]() |
提出日時 | 2016-09-09 22:30:47 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 1,000 ms |
コード長 | 990 bytes |
コンパイル時間 | 1,716 ms |
コンパイル使用メモリ | 164,676 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-11-16 10:24:48 |
合計ジャッジ時間 | 2,445 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 20 |
ソースコード
#include <bits/stdc++.h> using namespace std; // #define int long long typedef long long ll; typedef pair<int,int> pii; #define ITR(v,c) for(auto v=begin(c);v!=end(c);v++) #define FOR(v,a,n) for(int v=a;v<(int)(n);v++) #define FORE(x,arr) for(auto &x:arr) #define REP(v,n) FOR(v,0,n) #define RREP(v,n) for(int v=(int)(n);v>=0;v--) #define ALL(c) begin(c),end(c) const int DX[4]={0,1,0,-1}, DY[4]={-1,0,1,0}; const int INF = 1e9; const ll INFLL = 1e18; template<class T,class U>ostream&operator<<(ostream &os,const pair<T,U> &p){ os<<"("<<p.first<<","<<p.second<<")";return os;} template<class T>ostream&operator<<(ostream &os,const vector<T> &v){ ITR(i,v)os<<*i<<(i==end(v)-1?"":"\n");return os;} //------------------------------------------------------------------------------ signed main() { double a,b; cin>>a>>b; if(a==b) { printf("%f\n",sqrt(2)*a); } else printf("%f\n",min(min(sqrt(a*a+b*b),sqrt(a*a-b*b)),sqrt(b*b-a*a))); return 0; }