結果

問題 No.236 鴛鴦茶
ユーザー 14番14番
提出日時 2016-05-08 20:30:45
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 71 ms / 2,000 ms
コード長 1,885 bytes
コンパイル時間 2,336 ms
コンパイル使用メモリ 109,036 KB
実行使用メモリ 25,816 KB
最終ジャッジ日時 2023-09-10 22:03:59
合計ジャッジ時間 5,251 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 71 ms
23,796 KB
testcase_01 AC 70 ms
25,704 KB
testcase_02 AC 69 ms
23,848 KB
testcase_03 AC 70 ms
25,816 KB
testcase_04 AC 69 ms
23,736 KB
testcase_05 AC 70 ms
23,760 KB
testcase_06 AC 69 ms
23,836 KB
testcase_07 AC 68 ms
23,668 KB
testcase_08 AC 68 ms
25,792 KB
testcase_09 AC 69 ms
25,792 KB
testcase_10 AC 68 ms
25,692 KB
testcase_11 AC 69 ms
23,648 KB
testcase_12 AC 69 ms
25,616 KB
testcase_13 AC 68 ms
23,592 KB
testcase_14 AC 67 ms
23,728 KB
testcase_15 AC 69 ms
23,872 KB
testcase_16 AC 68 ms
23,596 KB
testcase_17 AC 69 ms
25,688 KB
testcase_18 AC 68 ms
23,660 KB
testcase_19 AC 69 ms
23,632 KB
testcase_20 AC 69 ms
23,636 KB
testcase_21 AC 68 ms
21,804 KB
testcase_22 AC 68 ms
21,644 KB
testcase_23 AC 69 ms
23,612 KB
testcase_24 AC 68 ms
23,780 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc)
Copyright (C) Microsoft Corporation. All rights reserved.

ソースコード

diff #

using System;
using System.Collections.Generic;
using System.Linq;

class Program
{
    public void Proc()
    {
        Reader.IsDebug = false;
        double[] inpt = Reader.ReadLine().Split(' ').Select(a=>double.Parse(a)).ToArray();
        double hi1 = inpt[0];
        double hi2 = inpt[1];
        double val1 = inpt[2];
        double val2 = inpt[3];
        double ans = 0;
        if(hi1 == hi2) {
            ans = Math.Min(val1, val2) * 2;
        } else
        {
            double tmp = val1 * hi2 / hi1;
            if(tmp > val2) {
                ans = val2 + (val2 * hi1 / hi2);
            } else
            {
                ans = val1 + tmp;
            }
        }
        Console.WriteLine(ans);

    }
    
    
    public class Reader
    {
        public static bool IsDebug = true;
        private static String PlainInput = @"

4 6 150 200
 
";
        private static System.IO.StringReader Sr = null;
        public static string ReadLine()
        {
            if (IsDebug)
            {
                if (Sr == null)
                {
                    Sr = new System.IO.StringReader(PlainInput.Trim());
                }
                return Sr.ReadLine();
            }
            else
            {
                return Console.ReadLine();
            }
        }
        public static int[] GetInt(char delimiter = ' ', bool trim = false)
        {
            string inptStr = ReadLine();
            if (trim)
            {
                inptStr = inptStr.Trim();
            }
            string[] inpt = inptStr.Split(delimiter);
            int[] ret = new int[inpt.Length];
            for (int i = 0; i < inpt.Length; i++)
            {
                ret[i] = int.Parse(inpt[i]);
            }
            return ret;
        }
    }
    static void Main()
    {
        Program prg = new Program();
        prg.Proc();
    }
}
0