結果

問題 No.314 ケンケンパ
ユーザー apahie
提出日時 2019-04-08 22:38:41
言語 Nim
(2.2.0)
結果
RE  
実行時間 -
コード長 200 bytes
コンパイル時間 3,032 ms
コンパイル使用メモリ 65,920 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-07-01 22:55:03
合計ジャッジ時間 3,931 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 6 RE * 11
権限があれば一括ダウンロードができます
コンパイルメッセージ
/home/judge/data/code/Main.nim(1, 8) Warning: imported and not used: 'sequtils' [UnusedImport]
/home/judge/data/code/Main.nim(1, 34) Warning: imported and not used: 'sugar' [UnusedImport]

ソースコード

diff #

import sequtils, strutils, math, sugar

const M = 10 ^ 9 + 7
let n = stdin.readLine.parseInt
var dp: seq[int64] = @[1'i64, 2'i64, 2'i64]

for i in 3..<n:
  dp.add dp[i-2] + dp[i-3]

echo dp[n-1] mod M
0