結果

問題 No.1219 Mancala Combo
ユーザー rutilicusrutilicus
提出日時 2020-09-06 11:07:56
言語 Kotlin
(1.9.23)
結果
WA  
実行時間 -
コード長 487 bytes
コンパイル時間 15,367 ms
コンパイル使用メモリ 425,536 KB
実行使用メモリ 72,212 KB
最終ジャッジ日時 2023-08-19 13:42:27
合計ジャッジ時間 29,233 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 296 ms
52,916 KB
testcase_01 AC 280 ms
52,880 KB
testcase_02 AC 281 ms
52,628 KB
testcase_03 AC 282 ms
52,892 KB
testcase_04 AC 293 ms
52,848 KB
testcase_05 AC 286 ms
52,768 KB
testcase_06 AC 289 ms
52,772 KB
testcase_07 AC 287 ms
52,840 KB
testcase_08 AC 291 ms
53,016 KB
testcase_09 AC 282 ms
52,676 KB
testcase_10 AC 291 ms
52,576 KB
testcase_11 AC 290 ms
52,988 KB
testcase_12 AC 289 ms
52,880 KB
testcase_13 AC 294 ms
52,616 KB
testcase_14 AC 288 ms
52,916 KB
testcase_15 AC 294 ms
52,628 KB
testcase_16 AC 292 ms
52,672 KB
testcase_17 AC 521 ms
63,540 KB
testcase_18 AC 531 ms
63,508 KB
testcase_19 AC 518 ms
63,772 KB
testcase_20 AC 538 ms
64,256 KB
testcase_21 AC 525 ms
63,708 KB
testcase_22 AC 529 ms
63,564 KB
testcase_23 AC 536 ms
63,496 KB
testcase_24 AC 532 ms
63,576 KB
testcase_25 AC 520 ms
63,660 KB
testcase_26 AC 534 ms
63,648 KB
testcase_27 AC 553 ms
72,212 KB
testcase_28 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.kt:17:13: warning: 'appendln(String?): 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("Yes")
            ^

ソースコード

diff #

fun main() {
    val builder = StringBuilder()

    val n = readInputLine().toInt()
    val aArr = readInputLine().split(" ").map { it.toInt() }.toIntArray()

    var addCnt = 0

    for (i in n - 1 downTo 0) {
        if ((addCnt + aArr[i]) % (i + 1) != 0) {
            println("No")
            return
        }
        addCnt += (addCnt + aArr[i]) / (i + 1)
    }

    builder.appendln("Yes")

    print(builder.toString())
}

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