結果

問題 No.2196 Pair Bonus
ユーザー バカらっくバカらっく
提出日時 2023-01-26 02:02:01
言語 Kotlin
(1.9.10)
結果
AC  
実行時間 1,214 ms / 2,000 ms
コード長 628 bytes
コンパイル時間 14,515 ms
コンパイル使用メモリ 420,860 KB
実行使用メモリ 110,884 KB
最終ジャッジ日時 2023-09-09 09:07:34
合計ジャッジ時間 28,938 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 296 ms
52,844 KB
testcase_01 AC 293 ms
53,060 KB
testcase_02 AC 296 ms
53,032 KB
testcase_03 AC 1,202 ms
110,352 KB
testcase_04 AC 1,214 ms
110,428 KB
testcase_05 AC 334 ms
53,440 KB
testcase_06 AC 327 ms
53,296 KB
testcase_07 AC 334 ms
53,276 KB
testcase_08 AC 589 ms
62,020 KB
testcase_09 AC 1,177 ms
110,884 KB
testcase_10 AC 909 ms
76,120 KB
testcase_11 AC 624 ms
66,632 KB
testcase_12 AC 1,016 ms
102,816 KB
testcase_13 AC 354 ms
53,260 KB
testcase_14 AC 535 ms
59,940 KB
testcase_15 AC 374 ms
53,316 KB
testcase_16 AC 1,078 ms
103,860 KB
testcase_17 AC 398 ms
53,452 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.kt:1:10: warning: parameter 'args' is never used
fun main(args: Array<String>) {
         ^

ソースコード

diff #

fun main(args: Array<String>) {
    println(getAns())
}

fun getAns():Long {
    val n = readLine()!!.toInt()
    val a = readLine()!!.split(" ").map { it.toLong() }
    val b = readLine()!!.split(" ").map { it.toLong() }
    val x = readLine()!!.split(" ").map { it.toLong() }
    val y = readLine()!!.split(" ").map { it.toLong() }

    var ans = 0L
    for(i in 0 until n) {
        var total = a[i*2] + a[i*2+1] + x[i]
        total = Math.max(total, a[i*2]+b[i*2+1]+y[i])
        total = Math.max(total, b[i*2]+a[i*2+1]+y[i])
        total = Math.max(total, b[i*2]+b[i*2+1]+x[i])
        ans += total
    }
    return ans
}
0