結果

問題 No.450 ベー君のシャトルラン
ユーザー ldsybldsyb
提出日時 2016-12-02 03:04:32
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 312 bytes
コンパイル時間 465 ms
コンパイル使用メモリ 69,144 KB
実行使用メモリ 6,820 KB
最終ジャッジ日時 2024-11-27 17:01:22
合計ジャッジ時間 38,236 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
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 < 30000000; i++){
		double time = d / (w + (i & 1 ? vl : vr));
		ans += time * w;
		d -= time * (vl + vr);
	}
	cout << fixed << setprecision(10) << ans << endl;
}
0