結果

問題 No.236 鴛鴦茶
ユーザー apprecapprec
提出日時 2015-07-06 11:36:39
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 113 ms / 2,000 ms
コード長 1,344 bytes
コンパイル時間 2,657 ms
コンパイル使用メモリ 106,436 KB
実行使用メモリ 28,520 KB
最終ジャッジ日時 2023-09-10 21:49:16
合計ジャッジ時間 6,034 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 113 ms
26,352 KB
testcase_01 AC 110 ms
28,344 KB
testcase_02 AC 110 ms
26,352 KB
testcase_03 AC 110 ms
26,444 KB
testcase_04 AC 111 ms
26,344 KB
testcase_05 AC 112 ms
26,512 KB
testcase_06 AC 111 ms
26,512 KB
testcase_07 AC 110 ms
26,312 KB
testcase_08 AC 110 ms
26,312 KB
testcase_09 AC 110 ms
26,416 KB
testcase_10 AC 110 ms
24,288 KB
testcase_11 AC 110 ms
26,324 KB
testcase_12 AC 110 ms
26,516 KB
testcase_13 AC 111 ms
26,300 KB
testcase_14 AC 111 ms
28,352 KB
testcase_15 AC 112 ms
28,300 KB
testcase_16 AC 111 ms
26,332 KB
testcase_17 AC 110 ms
26,392 KB
testcase_18 AC 112 ms
28,520 KB
testcase_19 AC 111 ms
26,412 KB
testcase_20 AC 111 ms
24,424 KB
testcase_21 AC 111 ms
26,300 KB
testcase_22 AC 111 ms
26,448 KB
testcase_23 AC 111 ms
28,360 KB
testcase_24 AC 111 ms
28,304 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.IO;
using System.Text.RegularExpressions;

namespace YukiCoder.No236 {
    class CoffeeTea {
        public static void Main() {
            var scn = new Scanner(Console.In);
            int[] a = scn.NextIntAry();
            int A = a[0], B = a[1], X = a[2], Y = a[3];

            double productMax = 0;
            if (A*Y >= B*X) { // coffee <= tea
                productMax = X * (A + B) / (double)A;
            } else {// coffee > tea
                productMax =  Y * (B + A) / (double)B;
            }

            Console.WriteLine("{0:F12}", productMax);
        }
    }

    public class Scanner {
        private TextReader tr;

        public Scanner(TextReader tr) {
            this.tr = tr;
        }

        public Scanner(string filePath) {
            this.tr = new StreamReader(filePath);
        }

        private string readLine() {
            return Regex.Replace(tr.ReadLine(), @"\s+", " ").Trim();
        }

        public string NextStr() {
            return readLine();
        }

        public string[] NextStrAry() {
            return readLine().Split(' ');
        }

        public int NextInt() {
            return int.Parse(readLine());
        }

        public int[] NextIntAry() {
            return Array.ConvertAll(readLine().Split(' '), int.Parse);
        }
    }
}
0