結果
| 問題 | No.44 DPなすごろく |
| ユーザー |
purple_jwl
|
| 提出日時 | 2016-10-29 10:24:22 |
| 言語 | Scala (3.10.0 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 297 ms / 5,000 ms |
| + 267µs | |
| コード長 | 303 bytes |
| 記録 | |
| コンパイル時間 | 8,828 ms |
| コンパイル使用メモリ | 267,596 KB |
| 実行使用メモリ | 59,188 KB |
| 最終ジャッジ日時 | 2026-10-11 07:48:05 |
| 合計ジャッジ時間 | 18,058 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge3_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 21 |
ソースコード
import scala.io.StdIn
object Main {
def main(args: Array[String]): Unit = {
val n = StdIn.readInt
val dp: Array[Long] = Array.fill(n + 1)(0)
dp(0) = 1
for (i <- (0 until n); j <- (1 to 2)) {
if (i + j <= n) {
dp(i + j) += dp(i)
}
}
println(dp(n))
}
}
purple_jwl