結果

問題 No.1381 Simple Geometry 1
ユーザー 蜜蜂
提出日時 2021-02-07 00:18:22
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 446 bytes
コンパイル時間 1,433 ms
コンパイル使用メモリ 166,532 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-07-03 12:25:18
合計ジャッジ時間 2,141 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 29
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;

using ll = long long;
using ld = long double;
#define fi first
#define se second
#define pb push_back

int main(){
  ld x,y,z,w;
  cin>>x>>y>>z>>w;
  
  ld maxw=sqrt(y*y+(x/y)*(x/y))-sqrt(y*y+z*z);
  ld minw=sqrt(y*y+z*z)-sqrt(z*z+(x/z)*(x/z));
  
  //cout<<minw<<" "<<maxw<<endl;
  
  if(w<minw||maxw<w){
    cout<<"WARNING"<<endl;
  }
  
  cout<<fixed<<setprecision(10);
  cout<<(x-y*z)/2<<endl;
}
0