結果

問題 No.786 京都大学の過去問
ユーザー firiexpfiriexp
提出日時 2019-03-03 01:13:09
言語 Kotlin
(1.9.23)
結果
AC  
実行時間 262 ms / 2,000 ms
コード長 190 bytes
コンパイル時間 11,218 ms
コンパイル使用メモリ 418,524 KB
実行使用メモリ 50,504 KB
最終ジャッジ日時 2023-08-13 01:22:19
合計ジャッジ時間 13,397 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 260 ms
50,328 KB
testcase_01 AC 262 ms
50,356 KB
testcase_02 AC 257 ms
50,248 KB
testcase_03 AC 256 ms
50,256 KB
testcase_04 AC 261 ms
50,504 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 dp = Array<Long>(n+1, {0})
    dp[0] = 1; dp[1] = 1
    for(i in 2..n) dp[i] = dp[i-1] + dp[i-2]
    println(dp[n])
}
0