結果

問題 No.1219 Mancala Combo
ユーザー rutilicusrutilicus
提出日時 2020-09-06 11:11:32
言語 Kotlin
(1.9.23)
結果
AC  
実行時間 606 ms / 2,000 ms
コード長 509 bytes
コンパイル時間 14,481 ms
コンパイル使用メモリ 414,672 KB
実行使用メモリ 72,316 KB
最終ジャッジ日時 2023-08-19 13:42:56
合計ジャッジ時間 25,637 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 286 ms
52,976 KB
testcase_01 AC 282 ms
52,860 KB
testcase_02 AC 284 ms
52,748 KB
testcase_03 AC 281 ms
53,068 KB
testcase_04 AC 291 ms
52,636 KB
testcase_05 AC 287 ms
52,768 KB
testcase_06 AC 294 ms
52,784 KB
testcase_07 AC 289 ms
53,444 KB
testcase_08 AC 288 ms
52,956 KB
testcase_09 AC 287 ms
52,724 KB
testcase_10 AC 281 ms
52,968 KB
testcase_11 AC 291 ms
52,792 KB
testcase_12 AC 284 ms
52,716 KB
testcase_13 AC 287 ms
52,736 KB
testcase_14 AC 286 ms
53,028 KB
testcase_15 AC 284 ms
52,632 KB
testcase_16 AC 287 ms
53,048 KB
testcase_17 AC 525 ms
63,636 KB
testcase_18 AC 541 ms
63,612 KB
testcase_19 AC 523 ms
63,620 KB
testcase_20 AC 540 ms
63,516 KB
testcase_21 AC 523 ms
64,100 KB
testcase_22 AC 535 ms
63,568 KB
testcase_23 AC 541 ms
72,316 KB
testcase_24 AC 527 ms
63,648 KB
testcase_25 AC 518 ms
65,484 KB
testcase_26 AC 536 ms
63,536 KB
testcase_27 AC 547 ms
72,060 KB
testcase_28 AC 606 ms
70,312 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
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.toLong() }.toLongArray()

    var addCnt = 0L

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

    builder.appendln("Yes")

    print(builder.toString())
}

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