結果

問題 No.450 ベー君のシャトルラン
ユーザー hotpepsihotpepsi
提出日時 2016-12-01 00:18:33
言語 C++11
(gcc 11.4.0)
結果
TLE  
実行時間 -
コード長 479 bytes
コンパイル時間 475 ms
コンパイル使用メモリ 59,568 KB
実行使用メモリ 10,752 KB
最終ジャッジ日時 2024-05-05 15:46:50
合計ジャッジ時間 4,171 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
10,752 KB
testcase_01 AC 1 ms
5,376 KB
testcase_02 AC 1 ms
5,376 KB
testcase_03 AC 2 ms
5,376 KB
testcase_04 AC 2 ms
5,376 KB
testcase_05 AC 2 ms
5,376 KB
testcase_06 AC 1 ms
5,376 KB
testcase_07 AC 1 ms
5,376 KB
testcase_08 AC 1 ms
5,376 KB
testcase_09 AC 2 ms
5,376 KB
testcase_10 AC 2 ms
5,376 KB
testcase_11 AC 2 ms
5,376 KB
testcase_12 AC 2 ms
5,376 KB
testcase_13 AC 2 ms
5,376 KB
testcase_14 AC 1 ms
5,376 KB
testcase_15 AC 1 ms
5,376 KB
testcase_16 AC 2 ms
5,376 KB
testcase_17 AC 1 ms
5,376 KB
testcase_18 AC 1 ms
5,376 KB
testcase_19 AC 1 ms
5,376 KB
testcase_20 AC 2 ms
5,376 KB
testcase_21 TLE -
testcase_22 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <sstream>
#include <algorithm>
#include <numeric>
#include <cstdio>

using namespace std;

int main(int argc, char *argv[]) {
	cout.precision(10);
	long double vl, vr, d, w, ans = 0, a = 999;
	cin >> vl >> vr >> d >> w;
	while (a > 1.0e-11 && d > 1.0e-11) {
		long double a = (d * w) / (w + vr), t = a / w;
		ans += a;
		d -= t * (vl + vr);
		a = (d * w) / (w + vl), t = a / w;
		ans += a;
		d -= t * (vl + vr);
	}
	cout << ans << endl;
	return 0;
}
0