結果

問題 No.236 鴛鴦茶
ユーザー javyjavy
提出日時 2015-11-13 02:14:05
言語 Kotlin
(1.9.23)
結果
AC  
実行時間 309 ms / 2,000 ms
コード長 703 bytes
コンパイル時間 14,570 ms
コンパイル使用メモリ 415,932 KB
実行使用メモリ 54,576 KB
最終ジャッジ日時 2023-08-12 14:51:03
合計ジャッジ時間 22,463 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 302 ms
52,812 KB
testcase_01 AC 301 ms
52,628 KB
testcase_02 AC 307 ms
52,656 KB
testcase_03 AC 309 ms
52,948 KB
testcase_04 AC 298 ms
52,744 KB
testcase_05 AC 306 ms
52,820 KB
testcase_06 AC 289 ms
52,856 KB
testcase_07 AC 296 ms
52,752 KB
testcase_08 AC 296 ms
52,712 KB
testcase_09 AC 294 ms
52,868 KB
testcase_10 AC 297 ms
52,940 KB
testcase_11 AC 294 ms
52,708 KB
testcase_12 AC 295 ms
52,820 KB
testcase_13 AC 294 ms
53,776 KB
testcase_14 AC 297 ms
54,576 KB
testcase_15 AC 298 ms
52,708 KB
testcase_16 AC 299 ms
52,720 KB
testcase_17 AC 298 ms
52,736 KB
testcase_18 AC 297 ms
52,740 KB
testcase_19 AC 293 ms
53,088 KB
testcase_20 AC 297 ms
52,980 KB
testcase_21 AC 294 ms
52,776 KB
testcase_22 AC 294 ms
52,652 KB
testcase_23 AC 303 ms
52,820 KB
testcase_24 AC 298 ms
52,856 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