結果

問題 No.786 京都大学の過去問
ユーザー firiexpfiriexp
提出日時 2019-03-03 01:11:58
言語 Kotlin
(1.9.23)
結果
WA  
実行時間 -
コード長 189 bytes
コンパイル時間 10,998 ms
コンパイル使用メモリ 426,260 KB
実行使用メモリ 54,188 KB
最終ジャッジ日時 2024-04-30 19:56:53
合計ジャッジ時間 10,952 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 241 ms
54,188 KB
testcase_01 AC 242 ms
54,152 KB
testcase_02 AC 241 ms
54,096 KB
testcase_03 WA -
testcase_04 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
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<Int>(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