結果

問題 No.450 ベー君のシャトルラン
ユーザー kotatsugame
提出日時 2016-12-01 00:22:19
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
TLE  
実行時間 -
コード長 401 bytes
コンパイル時間 601 ms
コンパイル使用メモリ 71,808 KB
実行使用メモリ 10,624 KB
最終ジャッジ日時 2024-11-27 14:31:23
合計ジャッジ時間 7,313 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 18 TLE * 2
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<iostream>
#include<algorithm>
#include<iomanip>
using namespace std;
const double EPS=1e-10;

int main()
{
	double v1,v2,d,w;
	cin>>v1>>v2>>d>>w;
	double sum=0.0;
	double a=w*d/(w+v2);
	sum+=a;
	double r1=(w-v1)/(w+v1);
	double r2=(w-v2)/(w+v2);
	int count=1;
	while(a>EPS)
	{
		if(count%2==0)a*=r2;
		else a*=r1;
		sum+=a;
		count++;
	}
	cout<<fixed<<setprecision(8)<<sum<<endl;
	return 0;
}
0