結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 RE -
testcase_01 AC 2 ms
4,384 KB
testcase_02 AC 2 ms
4,380 KB
testcase_03 AC 2 ms
4,380 KB
testcase_04 AC 2 ms
4,376 KB
testcase_05 AC 2 ms
4,380 KB
testcase_06 AC 1 ms
4,376 KB
testcase_07 AC 2 ms
4,380 KB
testcase_08 AC 2 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 = @[1, 2, 2]

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

echo dp[n-1] mod M
0