結果

問題 No.450 ベー君のシャトルラン
ユーザー mamekin
提出日時 2016-12-11 18:01:34
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 731 bytes
コンパイル時間 901 ms
コンパイル使用メモリ 98,412 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-11-29 03:34:10
合計ジャッジ時間 1,685 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 20
権限があれば一括ダウンロードができます

ソースコード

diff #

#define _USE_MATH_DEFINES
#include <cstdio>
#include <iostream>
#include <sstream>
#include <fstream>
#include <iomanip>
#include <algorithm>
#include <cmath>
#include <complex>
#include <string>
#include <vector>
#include <list>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <bitset>
#include <numeric>
#include <limits>
#include <climits>
#include <cfloat>
#include <functional>
#include <iterator>
using namespace std;

int main()
{
    double v1, v2, d, w;
    cin >> v1 >> v2 >> d >> w;
    v1 /= w;
    v2 /= w;

    double t = (2.0 * d) / ((v1 + 1) * (v2 + 1));
    double d2 = d - (v1 + v2) * t;

    double r = d2 / d;
    double ans = t / (1.0 - r);
    printf("%.10f\n", ans);

    return 0;
}
0