結果

問題 No.450 ベー君のシャトルラン
ユーザー ldsyb
提出日時 2016-12-01 21:09:32
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 312 bytes
コンパイル時間 750 ms
コンパイル使用メモリ 70,812 KB
実行使用メモリ 6,820 KB
最終ジャッジ日時 2024-11-27 16:13:11
合計ジャッジ時間 15,632 ms
ジャッジサーバーID
(参考情報)
judge1 / 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 < 10000000; i++){
		double time = d / (w + (i & 1 ? vl : vr));
		ans += time * w;
		d -= time * (vl + vr);
	}
	cout << fixed << setprecision(10) << ans << endl;
}
0