結果
問題 |
No.450 ベー君のシャトルラン
|
ユーザー |
![]() |
提出日時 | 2016-12-01 00:18:33 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
TLE
|
実行時間 | - |
コード長 | 479 bytes |
コンパイル時間 | 487 ms |
コンパイル使用メモリ | 58,204 KB |
実行使用メモリ | 10,624 KB |
最終ジャッジ日時 | 2024-11-27 14:26:29 |
合計ジャッジ時間 | 7,322 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 18 TLE * 2 |
ソースコード
#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; }