結果

問題 No.236 鴛鴦茶
ユーザー javyjavy
提出日時 2015-11-13 02:14:05
言語 Kotlin
(1.9.23)
結果
AC  
実行時間 274 ms / 2,000 ms
コード長 703 bytes
コンパイル時間 11,318 ms
コンパイル使用メモリ 434,388 KB
実行使用メモリ 57,060 KB
最終ジャッジ日時 2024-04-30 07:19:05
合計ジャッジ時間 17,378 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 268 ms
56,940 KB
testcase_01 AC 265 ms
57,060 KB
testcase_02 AC 268 ms
56,948 KB
testcase_03 AC 260 ms
56,992 KB
testcase_04 AC 262 ms
56,832 KB
testcase_05 AC 266 ms
56,820 KB
testcase_06 AC 265 ms
56,804 KB
testcase_07 AC 272 ms
56,944 KB
testcase_08 AC 264 ms
56,952 KB
testcase_09 AC 265 ms
56,924 KB
testcase_10 AC 270 ms
56,944 KB
testcase_11 AC 266 ms
56,816 KB
testcase_12 AC 261 ms
56,812 KB
testcase_13 AC 268 ms
56,860 KB
testcase_14 AC 274 ms
56,944 KB
testcase_15 AC 269 ms
56,768 KB
testcase_16 AC 271 ms
56,904 KB
testcase_17 AC 274 ms
56,892 KB
testcase_18 AC 266 ms
56,936 KB
testcase_19 AC 272 ms
56,800 KB
testcase_20 AC 263 ms
56,936 KB
testcase_21 AC 265 ms
56,812 KB
testcase_22 AC 272 ms
56,948 KB
testcase_23 AC 258 ms
56,928 KB
testcase_24 AC 266 ms
56,804 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.kt:6:10: warning: parameter 'args' is never used
fun main(args: Array<String>) {
         ^

ソースコード

diff #

package Yukicoder

/**
 * Created by hichikawa on 2015/11/12.
 */
fun main(args: Array<String>) {
    fun readLineIntArray() : List<Int> {
        val str = readLine() as String
        val arrStr = str.split(" ")
        val ret = arrStr.map { it.toInt() }
        return ret
    }

    val inputArrInt = readLineIntArray()
    val val1 = inputArrInt[0] * inputArrInt[3]
    val val2 = inputArrInt[1] * inputArrInt[2]
    if (val1 <= val2) {
        val ans = inputArrInt[3] + (inputArrInt[3] * (inputArrInt[0].toDouble() / inputArrInt[1]))
        println(ans)
    } else {
        val ans = inputArrInt[2] + (inputArrInt[2] * (inputArrInt[1].toDouble() / inputArrInt[0]))
        println(ans)
    }
}
0