結果

問題 No.44 DPなすごろく
ユーザー iwotiwot
提出日時 2019-12-20 23:09:26
言語 Kotlin
(1.9.23)
結果
AC  
実行時間 269 ms / 5,000 ms
コード長 240 bytes
コンパイル時間 14,969 ms
コンパイル使用メモリ 417,536 KB
実行使用メモリ 50,548 KB
最終ジャッジ日時 2023-09-25 01:26:03
合計ジャッジ時間 22,956 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 265 ms
50,392 KB
testcase_01 AC 264 ms
49,996 KB
testcase_02 AC 269 ms
50,036 KB
testcase_03 AC 263 ms
50,548 KB
testcase_04 AC 260 ms
50,160 KB
testcase_05 AC 264 ms
50,020 KB
testcase_06 AC 263 ms
50,108 KB
testcase_07 AC 259 ms
50,104 KB
testcase_08 AC 260 ms
50,068 KB
testcase_09 AC 268 ms
50,004 KB
testcase_10 AC 260 ms
50,312 KB
testcase_11 AC 260 ms
50,056 KB
testcase_12 AC 263 ms
49,992 KB
testcase_13 AC 263 ms
50,144 KB
testcase_14 AC 265 ms
50,332 KB
testcase_15 AC 264 ms
50,432 KB
testcase_16 AC 268 ms
50,060 KB
testcase_17 AC 262 ms
50,276 KB
testcase_18 AC 264 ms
49,912 KB
testcase_19 AC 266 ms
50,112 KB
testcase_20 AC 265 ms
49,912 KB
testcase_21 AC 265 ms
50,344 KB
testcase_22 AC 265 ms
50,048 KB
testcase_23 AC 267 ms
50,308 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.kt:1:10: warning: parameter 'args' is never used
fun main(args: Array<String>) {
         ^

ソースコード

diff #

fun main(args: Array<String>) {
    val n = readLine()!!.toInt()
    val list: MutableList<Long> = mutableListOf()
    list.add(1)
    list.add(1)

    for (i in 2..n) {
        list.add(list[i-1] + list[i-2])
    }

    println(list[n])
}
0