結果

問題 No.450 ベー君のシャトルラン
ユーザー ldsyb
提出日時 2016-12-01 21:02:13
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 311 bytes
コンパイル時間 486 ms
コンパイル使用メモリ 70,448 KB
実行使用メモリ 6,820 KB
最終ジャッジ日時 2024-11-27 16:04:58
合計ジャッジ時間 2,776 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 18 WA * 2
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <iomanip>
using namespace std;

int main(){
	double ans = 0, vl, vr, d, w;
	cin >> vl >> vr >> d >> w;
	for(int i = 0; i < 1000000; i++){
		double time = d / (w + (i & 1 ? vl : vr));
		ans += time * w;
		d -= time * (vl + vr);
	}
	cout << fixed << setprecision(10) << ans << endl;
}
0