結果

問題 No.1225 I hate I hate Matrix Construction
ユーザー rutilicusrutilicus
提出日時 2020-09-12 11:57:39
言語 Kotlin
(1.9.23)
結果
WA  
実行時間 -
コード長 566 bytes
コンパイル時間 14,500 ms
コンパイル使用メモリ 416,788 KB
実行使用メモリ 53,088 KB
最終ジャッジ日時 2023-08-30 05:07:02
合計ジャッジ時間 27,277 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 283 ms
52,696 KB
testcase_01 AC 283 ms
52,692 KB
testcase_02 AC 284 ms
52,808 KB
testcase_03 AC 285 ms
52,868 KB
testcase_04 AC 285 ms
52,664 KB
testcase_05 AC 285 ms
52,904 KB
testcase_06 AC 285 ms
52,832 KB
testcase_07 AC 283 ms
53,012 KB
testcase_08 AC 284 ms
52,844 KB
testcase_09 AC 287 ms
52,808 KB
testcase_10 AC 286 ms
52,752 KB
testcase_11 AC 285 ms
52,848 KB
testcase_12 AC 287 ms
52,656 KB
testcase_13 AC 283 ms
52,912 KB
testcase_14 AC 285 ms
52,660 KB
testcase_15 AC 290 ms
53,040 KB
testcase_16 AC 288 ms
52,816 KB
testcase_17 AC 290 ms
52,844 KB
testcase_18 AC 289 ms
52,692 KB
testcase_19 AC 287 ms
52,692 KB
testcase_20 AC 287 ms
52,840 KB
testcase_21 AC 287 ms
52,804 KB
testcase_22 AC 288 ms
52,704 KB
testcase_23 AC 283 ms
52,736 KB
testcase_24 AC 286 ms
52,752 KB
testcase_25 AC 286 ms
52,920 KB
testcase_26 AC 286 ms
53,012 KB
testcase_27 AC 282 ms
52,988 KB
testcase_28 AC 290 ms
52,816 KB
testcase_29 AC 286 ms
53,020 KB
testcase_30 AC 286 ms
52,884 KB
testcase_31 AC 286 ms
52,672 KB
testcase_32 AC 287 ms
52,828 KB
testcase_33 AC 289 ms
52,660 KB
testcase_34 WA -
testcase_35 WA -
testcase_36 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.kt:29:13: warning: 'appendln(Int): kotlin.text.StringBuilder /* = java.lang.StringBuilder */' is deprecated. Use appendLine instead. Note that the new method always appends the line feed character '\n' regardless of the system line separator.
    builder.appendln(max(rowCnt, colCnt))
            ^

ソースコード

diff #

import kotlin.math.max

fun main() {
    val builder = StringBuilder()

    val n = readInputLine().toInt()

    val s = readInputLine()
    val t = readInputLine()

    var rowCnt = 0

    for (c in s) {
        when (c) {
            '1' -> rowCnt++
            '2' -> rowCnt += n
        }
    }

    var colCnt = 0

    for (c in t) {
        when (c) {
            '1' -> colCnt++
            '2' -> colCnt += n
        }
    }

    builder.appendln(max(rowCnt, colCnt))

    print(builder.toString())
}

fun readInputLine(): String {
    return readLine()!!
}
0