結果
問題 | No.554 recurrence formula |
ユーザー |
![]() |
提出日時 | 2017-08-11 23:15:56 |
言語 | Nim (2.2.0) |
結果 |
AC
|
実行時間 | 6 ms / 2,000 ms |
コード長 | 396 bytes |
コンパイル時間 | 2,903 ms |
コンパイル使用メモリ | 65,152 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-06-30 02:07:47 |
合計ジャッジ時間 | 3,400 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 21 |
コンパイルメッセージ
/home/judge/data/code/Main.nim(1, 8) Warning: imported and not used: 'sequtils' [UnusedImport]
ソースコード
import sequtils,strutilsvarN = stdin.readline.parseIntA : array[100_010,int64]Sodd = ASeven = Am : int64 = (1e9).int + 7A[1] = 1Sodd[1] = 1for n in 2..N:if (n and 1) == 1:A[n] = (Seven[n - 1] * n) mod mSodd[n] = (Sodd[n - 2] + A[n]) mod melse:A[n] = (Sodd[n - 1] * n) mod mSeven[n] = (Seven[n - 2] + A[n]) mod mecho A[N]