結果

問題 No.450 ベー君のシャトルラン
ユーザー mayoko_mayoko_
提出日時 2016-12-01 22:50:39
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 566 bytes
コンパイル時間 590 ms
コンパイル使用メモリ 80,392 KB
実行使用メモリ 6,820 KB
最終ジャッジ日時 2024-11-27 16:23:29
合計ジャッジ時間 1,332 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 20
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<iostream>
#include<vector>
#include<string>
#include<cstring>
#include<algorithm>
#include<map>
#include<set>
#include<cmath>
#include<cassert>
#include<queue>

using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> pii;
typedef vector<int> vi;

int main() {
	double vl, vr;
	double d;
	double w;
	cin >> vl >> vr;
	cin >> d;
	cin >> w;
	double t1 = d/(w+vr);
	double d1 = d-t1*(vl+vr);
	double t2 = d1/(vl+w);
	double d2 = d1-t2*(vl+vr);
	double ans = (t1+t2)*w / (1-d2/d);
	printf("%.10lf\n", ans);
	return 0;
}
0