結果

問題 No.236 鴛鴦茶
ユーザー nokonoko
提出日時 2015-07-05 22:34:20
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 32 ms / 2,000 ms
コード長 2,175 bytes
コンパイル時間 1,392 ms
コンパイル使用メモリ 113,336 KB
実行使用メモリ 20,224 KB
最終ジャッジ日時 2024-06-28 12:49:28
合計ジャッジ時間 2,603 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 23
権限があれば一括ダウンロードができます
コンパイルメッセージ
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;
namespace YukiCoderNo236
{
class Program
{
static void Main()
{
double[] buffer = LIB.IO.R<double>(' ');
double per1 = buffer[0] * buffer[3];
double per2 = buffer[1] * buffer[2];
double ans = 0;
if (per1 >= per2)
{
ans = buffer[2] + buffer[2] * buffer[1] / buffer[0];
}
else
{
ans = buffer[3] + buffer[3] * buffer[0] / buffer[1];
}
LIB.IO.W(ans);
LIB.IO.WFLUSH();
}
}
}
namespace LIB
{
public class IO
{
private const int WMAX = 1000;
private static string WSTRING = "";
public static T R<T>()
{
return (T)(Convert.ChangeType(R(), typeof(T)));
}
public static T[] R<T>(char splitter = ' ')
{
return R().Split(splitter).Select(v => UTILITY.PARSE<T>(v)).ToArray();
}
public static T[] R<T>(int length)
{
T[] ret = new T[length];
for (int i = 0; i < length; i++)
{
ret[i] = R<T>();
}
return ret;
}
public static T[][] R<T>(int length, char splitter = ' ')
{
T[][] ret = new T[length][];
for (int i = 0; i < length; i++)
{
ret[i] = R<T>(splitter);
}
return ret;
}
private static string R()
{
return Console.ReadLine();
}
public static void W(object value, bool addLineFeed = true)
{
WSTRING += UTILITY.PARSE<string>(value);
if (addLineFeed == true) { WSTRING += "\n"; }
if (WSTRING.Count() >= WMAX) { WFLUSH(); }
}
public static void WFLUSH()
{
Console.Write(WSTRING);
WSTRING = "";
}
}
public class UTILITY
{
public static T PARSE<T>(object value)
{
return (T)(Convert.ChangeType(value, typeof(T)));
}
}
}
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
0