結果

問題 No.314 ケンケンパ
ユーザー apahieapahie
提出日時 2019-04-08 22:38:41
言語 Nim
(2.0.2)
結果
RE  
実行時間 -
コード長 200 bytes
コンパイル時間 3,006 ms
コンパイル使用メモリ 67,932 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-09-14 15:44:36
合計ジャッジ時間 4,567 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 RE -
testcase_01 AC 2 ms
4,376 KB
testcase_02 AC 2 ms
4,376 KB
testcase_03 AC 2 ms
4,376 KB
testcase_04 AC 1 ms
4,380 KB
testcase_05 AC 1 ms
4,376 KB
testcase_06 AC 2 ms
4,380 KB
testcase_07 AC 2 ms
4,376 KB
testcase_08 AC 1 ms
4,380 KB
testcase_09 AC 2 ms
4,376 KB
testcase_10 RE -
testcase_11 RE -
testcase_12 RE -
testcase_13 RE -
testcase_14 RE -
testcase_15 RE -
testcase_16 RE -
testcase_17 RE -
testcase_18 RE -
testcase_19 RE -
権限があれば一括ダウンロードができます
コンパイルメッセージ
/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