結果

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

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;

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

	double v1, v2, d, w;
	cin >> v1 >> v2 >> d >> w;

	double ans = 0;
	for(int i = 0; i < 20000000; i++) {
		if(i % 2 == 0) {
			double t = d / (w + v2);
			ans += w * t;
			d -= t * (v1 + v2);
		}
		else {
			double t = d / (w + v1);
			ans += w * t;
			d -= t * (v1 + v2);
		}
	}
	cout << fixed << setprecision(15) << ans << endl;
}
0