結果
問題 |
No.450 ベー君のシャトルラン
|
ユーザー |
![]() |
提出日時 | 2016-12-01 00:20:14 |
言語 | Java (openjdk 23) |
結果 |
WA
|
実行時間 | - |
コード長 | 409 bytes |
コンパイル時間 | 2,503 ms |
コンパイル使用メモリ | 73,960 KB |
実行使用メモリ | 53,832 KB |
最終ジャッジ日時 | 2024-11-27 14:29:53 |
合計ジャッジ時間 | 8,700 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 18 WA * 2 |
ソースコード
import java.util.*; class B{ static Scanner s = new Scanner(System.in); public static void main(String[] args) { int vl=s.nextInt(), vr=s.nextInt(), d =s.nextInt(), w =s.nextInt(); double xl=0, xr=d, r=0; for(int i=0;i<11451419;++i){ double t=(i%2==0)? (xr-xl)/(w+vr): (xr-xl)/(w+vl); r+=t*w; xl+=t*vl; xr-=t*vr; } System.out.printf("%.20f\n",r); } }