結果
問題 | No.314 ケンケンパ |
ユーザー |
|
提出日時 | 2019-04-08 22:42:13 |
言語 | Nim (2.2.0) |
結果 |
AC
|
実行時間 | 26 ms / 1,000 ms |
コード長 | 202 bytes |
コンパイル時間 | 3,089 ms |
コンパイル使用メモリ | 65,772 KB |
実行使用メモリ | 30,388 KB |
最終ジャッジ日時 | 2024-07-01 22:55:11 |
合計ジャッジ時間 | 3,954 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 17 |
コンパイルメッセージ
/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]
ソースコード
import sequtils, strutils, math, sugarconst M = 10 ^ 9 + 7let n = stdin.readLine.parseIntvar dp: seq[int64] = @[1'i64, 2'i64, 2'i64]for i in 3..<n:dp.add (dp[i-2] + dp[i-3]) mod Mecho dp[n-1]