結果
| 問題 |
No.533 Mysterious Stairs
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2017-06-24 08:02:22 |
| 言語 | Ruby (3.4.1) |
| 結果 |
AC
|
| 実行時間 | 3,173 ms / 5,000 ms |
| コード長 | 143 bytes |
| コンパイル時間 | 171 ms |
| コンパイル使用メモリ | 7,552 KB |
| 実行使用メモリ | 107,264 KB |
| 最終ジャッジ日時 | 2024-10-04 05:13:45 |
| 合計ジャッジ時間 | 14,486 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 28 |
コンパイルメッセージ
Main.rb:4: warning: possibly useless use of -@ in void context Syntax OK
ソースコード
M=10**9+7
d=Array.new(4+N=gets.to_i){[0]*4}
d[1][1]=d[2][2]=d[3][3]=1
-~N.times{|i|(1..3).map{|j|d[i+j][j]+=(d[i].sum-d[i][j])%M}}
p d[N].sum%M