結果

問題 No.306 さいたま2008
ユーザー mint6421mint6421
提出日時 2019-08-27 23:14:07
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 1,053 bytes
コンパイル時間 1,427 ms
コンパイル使用メモリ 164,784 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-08-10 23:30:00
合計ジャッジ時間 3,036 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 23 ms
4,380 KB
testcase_01 AC 23 ms
4,380 KB
testcase_02 AC 23 ms
4,380 KB
testcase_03 AC 23 ms
4,376 KB
testcase_04 AC 23 ms
4,376 KB
testcase_05 AC 24 ms
4,380 KB
testcase_06 AC 23 ms
4,380 KB
testcase_07 WA -
testcase_08 AC 23 ms
4,376 KB
testcase_09 AC 24 ms
4,380 KB
testcase_10 AC 23 ms
4,376 KB
testcase_11 AC 23 ms
4,376 KB
testcase_12 AC 24 ms
4,380 KB
testcase_13 AC 24 ms
4,380 KB
testcase_14 AC 24 ms
4,380 KB
testcase_15 AC 23 ms
4,380 KB
testcase_16 AC 22 ms
4,376 KB
testcase_17 AC 23 ms
4,376 KB
testcase_18 AC 23 ms
4,376 KB
testcase_19 AC 24 ms
4,380 KB
testcase_20 WA -
testcase_21 WA -
testcase_22 AC 23 ms
4,380 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;
#define inf INT_MAX
#define INF LLONG_MAX
#define ll long long
#define ull unsigned long long
#define M (int)(1e9+7)
#define P pair<int,int>
#define PLL pair<ll,ll>
#define FOR(i,m,n) for(int i=(int)m;i<(int)n;i++)
#define RFOR(i,m,n) for(int i=(int)m;i>=(int)n;i--)
#define rep(i,n) FOR(i,0,n)
#define rrep(i,n) RFOR(i,n,0)
#define all(a) a.begin(),a.end()
#define IN(a,n) rep(i,n){ cin>>a[i]; }
const int vx[4] = {0,1,0,-1};
const int vy[4] = {1,0,-1,0};
#define PI 3.14159265
#define F first
#define S second
#define PB push_back
#define EB emplace_back
#define int ll
#define vi vector<int>

double xa,ya,xb,yb;

double f(double k){
  return sqrt(xa*xa+(ya-k)*(ya-k))+sqrt(xb*xb+(yb-k)*(yb-k));
}

signed main(){
  cin.tie(0);
  ios::sync_with_stdio(false);


  cin>>xa>>ya>>xb>>yb;
  if(ya>yb){
    swap(xa,xb);
    swap(ya,yb);
  }

  double l=0,r=1000;
  int t=1000000;

  while(t--){
    double m=(r+l)/2;
    double lt=f(l),rt=f(r);
    if(rt>lt) r=m;
    else l=m;
  }

  printf("%.10lf\n",l);


}
0