結果
問題 |
No.450 ベー君のシャトルラン
|
ユーザー |
|
提出日時 | 2016-12-02 01:15:55 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 482 bytes |
コンパイル時間 | 515 ms |
コンパイル使用メモリ | 70,448 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-11-27 16:55:37 |
合計ジャッジ時間 | 5,365 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 18 WA * 2 |
ソースコード
#include <iostream> #include <iomanip> using namespace std; int main() { long double vl, vr, d, w, ans = 0; cin >> vl >> vr >> d >> w; int i = 0; while (d > 0.000001 && i < 100000000) { long double t1 = d / (w + vr); ans += w * t1; d -= (vl + vr) * t1; long double t2 = d / (w + vl); ans += w * t2; d -= (vl + vr) * t2; i++; } cout << fixed << setprecision(9) << ans << endl; return 0; }