結果

問題 No.208 王将
ユーザー javyjavy
提出日時 2015-12-07 04:35:53
言語 Kotlin
(1.9.23)
結果
AC  
実行時間 301 ms / 1,000 ms
コード長 1,418 bytes
コンパイル時間 12,726 ms
コンパイル使用メモリ 416,456 KB
実行使用メモリ 53,488 KB
最終ジャッジ日時 2023-08-12 17:04:58
合計ジャッジ時間 21,514 ms
ジャッジサーバーID
(参考情報)
judge7 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 286 ms
53,184 KB
testcase_01 AC 286 ms
52,980 KB
testcase_02 AC 288 ms
53,040 KB
testcase_03 AC 291 ms
52,920 KB
testcase_04 AC 293 ms
52,956 KB
testcase_05 AC 290 ms
53,068 KB
testcase_06 AC 295 ms
53,068 KB
testcase_07 AC 295 ms
53,168 KB
testcase_08 AC 288 ms
53,020 KB
testcase_09 AC 288 ms
52,932 KB
testcase_10 AC 293 ms
53,332 KB
testcase_11 AC 291 ms
52,980 KB
testcase_12 AC 297 ms
53,000 KB
testcase_13 AC 287 ms
53,040 KB
testcase_14 AC 285 ms
53,056 KB
testcase_15 AC 286 ms
53,084 KB
testcase_16 AC 287 ms
52,896 KB
testcase_17 AC 291 ms
53,060 KB
testcase_18 AC 288 ms
52,904 KB
testcase_19 AC 289 ms
52,912 KB
testcase_20 AC 301 ms
52,964 KB
testcase_21 AC 288 ms
53,488 KB
testcase_22 AC 291 ms
52,840 KB
testcase_23 AC 295 ms
52,976 KB
testcase_24 AC 289 ms
53,000 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.kt:3:10: warning: parameter 'args' is never used
fun main(args: Array<String>) {
         ^

ソースコード

diff #

package Yukicoder

fun main(args: Array<String>) {
    fun readLineLongArray(): List<Long> {
        val str = readLine() as String
        val arrStr = str.split(" ")
        val ret = arrStr.map { it.toLong() }
        return ret
    }

    fun readLineLong(): Long {
        val str = readLine() as String
        return str.toLong()
    }

    fun readLineInt(): Int {
        val str = readLine() as String
        return str.toInt()
    }

    fun readLineIntArray() : List<Int> {
        val str = readLine() as String
        val arrStr = str.split(" ")
        val ret = arrStr.map { it.toInt() }
        return ret
    }

    fun readLineDoubleArray(): List<Double> {
        val str = readLine() as String
        val arrStr = str.split(" ")
        val ret = arrStr.map { it.toDouble() }
        return ret
    }

    fun readLineDouble() : Double {
        val str = readLine() as String
        return str.toDouble()
    }

    fun readLineString() : String {
        return readLine() as String
    }

//    fun readLineStringArray(): List<String> {
//        val str = readLine() as String
//        val arrStr = str.split(" ")
//        return arrStr
//    }

    val goal = readLineIntArray()
    val fu = readLineIntArray()
    if (goal[0] == goal[1] && fu[0] == fu[1] && fu[0] < goal[0]) {
        println(Math.max(goal[0],goal[1])+1)
    } else {
        println(Math.max(goal[0],goal[1]))
    }
}
0