結果

問題 No.450 ベー君のシャトルラン
ユーザー ldsybldsyb
提出日時 2016-12-02 03:04:32
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 312 bytes
コンパイル時間 512 ms
コンパイル使用メモリ 69,376 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-05-05 17:24:30
合計ジャッジ時間 40,294 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1,713 ms
5,248 KB
testcase_01 AC 1,727 ms
5,376 KB
testcase_02 AC 1,707 ms
5,376 KB
testcase_03 AC 1,722 ms
5,376 KB
testcase_04 AC 1,733 ms
5,376 KB
testcase_05 AC 1,708 ms
5,376 KB
testcase_06 AC 1,703 ms
5,376 KB
testcase_07 AC 1,761 ms
5,376 KB
testcase_08 AC 1,699 ms
5,376 KB
testcase_09 AC 1,754 ms
5,376 KB
testcase_10 AC 1,736 ms
5,376 KB
testcase_11 AC 1,733 ms
5,376 KB
testcase_12 AC 1,707 ms
5,376 KB
testcase_13 AC 1,727 ms
5,376 KB
testcase_14 AC 1,706 ms
5,376 KB
testcase_15 AC 1,720 ms
5,376 KB
testcase_16 AC 1,738 ms
5,376 KB
testcase_17 AC 1,704 ms
5,376 KB
testcase_18 AC 1,688 ms
5,376 KB
testcase_19 AC 1,697 ms
5,376 KB
testcase_20 AC 1,710 ms
5,376 KB
testcase_21 WA -
testcase_22 WA -
権限があれば一括ダウンロードができます

ソースコード

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