結果

問題 No.741 AscNumber(Easy)
ユーザー rutilicusrutilicus
提出日時 2020-10-07 21:11:27
言語 Kotlin
(1.9.23)
結果
AC  
実行時間 653 ms / 2,000 ms
コード長 506 bytes
コンパイル時間 14,987 ms
コンパイル使用メモリ 419,240 KB
実行使用メモリ 185,504 KB
最終ジャッジ日時 2023-09-27 09:58:00
合計ジャッジ時間 38,497 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 307 ms
55,992 KB
testcase_01 AC 297 ms
56,076 KB
testcase_02 AC 296 ms
56,072 KB
testcase_03 AC 300 ms
55,992 KB
testcase_04 AC 300 ms
56,084 KB
testcase_05 AC 298 ms
55,968 KB
testcase_06 AC 300 ms
56,008 KB
testcase_07 AC 298 ms
55,936 KB
testcase_08 AC 296 ms
55,904 KB
testcase_09 AC 299 ms
56,264 KB
testcase_10 AC 298 ms
56,072 KB
testcase_11 AC 303 ms
56,044 KB
testcase_12 AC 301 ms
56,096 KB
testcase_13 AC 300 ms
56,044 KB
testcase_14 AC 299 ms
56,068 KB
testcase_15 AC 308 ms
56,020 KB
testcase_16 AC 302 ms
55,992 KB
testcase_17 AC 304 ms
55,880 KB
testcase_18 AC 305 ms
55,980 KB
testcase_19 AC 306 ms
55,936 KB
testcase_20 AC 305 ms
56,028 KB
testcase_21 AC 306 ms
56,064 KB
testcase_22 AC 302 ms
56,020 KB
testcase_23 AC 301 ms
56,188 KB
testcase_24 AC 306 ms
55,980 KB
testcase_25 AC 302 ms
56,180 KB
testcase_26 AC 302 ms
56,440 KB
testcase_27 AC 305 ms
55,948 KB
testcase_28 AC 307 ms
55,948 KB
testcase_29 AC 304 ms
55,972 KB
testcase_30 AC 310 ms
55,984 KB
testcase_31 AC 306 ms
56,008 KB
testcase_32 AC 303 ms
56,044 KB
testcase_33 AC 308 ms
56,068 KB
testcase_34 AC 312 ms
56,484 KB
testcase_35 AC 653 ms
143,248 KB
testcase_36 AC 429 ms
89,676 KB
testcase_37 AC 460 ms
116,176 KB
testcase_38 AC 463 ms
116,276 KB
testcase_39 AC 437 ms
89,712 KB
testcase_40 AC 479 ms
116,252 KB
testcase_41 AC 568 ms
135,096 KB
testcase_42 AC 460 ms
114,192 KB
testcase_43 AC 413 ms
84,128 KB
testcase_44 AC 548 ms
134,880 KB
testcase_45 AC 547 ms
126,628 KB
testcase_46 AC 567 ms
137,104 KB
testcase_47 AC 359 ms
66,992 KB
testcase_48 AC 571 ms
137,128 KB
testcase_49 AC 553 ms
126,552 KB
testcase_50 AC 341 ms
67,084 KB
testcase_51 AC 414 ms
84,216 KB
testcase_52 AC 624 ms
185,180 KB
testcase_53 AC 628 ms
185,504 KB
testcase_54 AC 624 ms
185,176 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.kt:22:13: warning: 'appendln(Long): 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(dp[n - 1].sum() % mod)
            ^

ソースコード

diff #

fun main() {
    val builder = StringBuilder()

    val mod = 1000000007L

    val n = readInputLine().toInt()

    val dp = Array(n) { LongArray(10) }

    for (i in 0..9) {
        dp[0][i] = 1L
    }

    for (i in 1 until n) {
        var current = 0L
        for (j in 0..9) {
            current += dp[i - 1][j]
            dp[i][j] = current % mod
        }
    }

    builder.appendln(dp[n - 1].sum() % mod)

    print(builder.toString())
}

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