結果

問題 No.450 ベー君のシャトルラン
ユーザー femtofemto
提出日時 2016-12-01 02:11:10
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 458 bytes
コンパイル時間 2,707 ms
コンパイル使用メモリ 165,248 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-08-18 10:45:03
合計ジャッジ時間 16,686 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 592 ms
4,380 KB
testcase_01 AC 601 ms
4,376 KB
testcase_02 AC 594 ms
4,376 KB
testcase_03 AC 588 ms
4,376 KB
testcase_04 AC 589 ms
4,380 KB
testcase_05 AC 596 ms
4,376 KB
testcase_06 AC 601 ms
4,376 KB
testcase_07 AC 591 ms
4,380 KB
testcase_08 AC 597 ms
4,376 KB
testcase_09 AC 597 ms
4,376 KB
testcase_10 AC 594 ms
4,376 KB
testcase_11 AC 597 ms
4,376 KB
testcase_12 AC 600 ms
4,380 KB
testcase_13 AC 621 ms
4,376 KB
testcase_14 AC 620 ms
4,376 KB
testcase_15 AC 619 ms
4,376 KB
testcase_16 AC 619 ms
4,376 KB
testcase_17 AC 618 ms
4,376 KB
testcase_18 AC 617 ms
4,376 KB
testcase_19 AC 618 ms
4,380 KB
testcase_20 AC 598 ms
4,380 KB
testcase_21 WA -
testcase_22 WA -
権限があれば一括ダウンロードができます

ソースコード

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 < 10000000; 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