結果

問題 No.450 ベー君のシャトルラン
ユーザー wowilsonwowilson
提出日時 2016-12-03 13:06:49
言語 C#(csc)
(csc 3.9.0)
結果
TLE  
実行時間 -
コード長 771 bytes
コンパイル時間 3,536 ms
コンパイル使用メモリ 102,260 KB
実行使用メモリ 29,016 KB
最終ジャッジ日時 2023-08-18 12:49:48
合計ジャッジ時間 8,174 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 62 ms
29,016 KB
testcase_01 AC 62 ms
24,640 KB
testcase_02 AC 63 ms
24,768 KB
testcase_03 AC 61 ms
22,632 KB
testcase_04 AC 62 ms
22,640 KB
testcase_05 AC 61 ms
22,796 KB
testcase_06 AC 62 ms
22,560 KB
testcase_07 AC 61 ms
22,684 KB
testcase_08 AC 61 ms
24,708 KB
testcase_09 AC 61 ms
22,780 KB
testcase_10 AC 62 ms
24,732 KB
testcase_11 AC 61 ms
24,740 KB
testcase_12 AC 62 ms
22,636 KB
testcase_13 AC 61 ms
22,612 KB
testcase_14 AC 61 ms
22,692 KB
testcase_15 AC 62 ms
22,604 KB
testcase_16 AC 61 ms
22,684 KB
testcase_17 AC 61 ms
24,724 KB
testcase_18 AC 62 ms
22,720 KB
testcase_19 AC 62 ms
24,696 KB
testcase_20 AC 62 ms
24,692 KB
testcase_21 TLE -
testcase_22 -- -
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc)
Copyright (C) Microsoft Corporation. All rights reserved.

ソースコード

diff #

using System;

namespace Yukicoder
{
    public class Program
    {
        public static void Main()
        {
            var v = Console.ReadLine().Split();
            double vL = int.Parse(v[0]);
            double vR = int.Parse(v[1]);
            double d = int.Parse(Console.ReadLine());
            double w = int.Parse(Console.ReadLine());
            bool isRight = true;
            double sum = 0;
            while (d > double.Epsilon)
            {
                double t = isRight ? d / (vR + w) : d / (vL + w);
                if (t < double.Epsilon)
                    break;
                sum += w * t;
                isRight = !isRight;
                d = d - (vL + vR) * t;
            }
            Console.WriteLine(sum);
        }
    }
}

0