結果

問題 No.450 ベー君のシャトルラン
ユーザー autumn-eel
提出日時 2016-12-02 22:48:57
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
TLE  
実行時間 -
コード長 380 bytes
コンパイル時間 1,317 ms
コンパイル使用メモリ 158,384 KB
実行使用メモリ 10,020 KB
最終ジャッジ日時 2024-11-27 17:47:52
合計ジャッジ時間 8,136 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 18 TLE * 2
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:19:22: warning: use of ‘ll’ length modifier with ‘f’ type character has either no effect or undefined behavior [-Wformat=]
   19 |         printf("%.7llf\n", ans);
      |                      ^

ソースコード

diff #

#include<bits/stdc++.h>
#define double long double
#define EPS (1e-6)
#define rep(i,n)for(int i=0;i<n;i++)
using namespace std;

int main() {
	double vl, vr, d, w; cin >> vl >> vr >> d >> w;
	bool b = true;
	double ans = 0;
	while (d > EPS) {
		double t;
		if (b)t = d / (vr + w);
		else t = d / (vl + w);
		ans += t*w;
		d -= t*(vl + vr);
		b = !b;
	}
	printf("%.7llf\n", ans);
}
0