結果
問題 |
No.741 AscNumber(Easy)
|
ユーザー |
![]() |
提出日時 | 2020-10-07 21:11:27 |
言語 | Kotlin (2.1.0) |
結果 |
AC
|
実行時間 | 662 ms / 2,000 ms |
コード長 | 506 bytes |
コンパイル時間 | 13,828 ms |
コンパイル使用メモリ | 432,252 KB |
実行使用メモリ | 184,148 KB |
最終ジャッジ日時 | 2024-07-20 04:06:39 |
合計ジャッジ時間 | 38,695 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 55 |
コンパイルメッセージ
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) ^
ソースコード
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()!! }