結果

問題 No.658 テトラナッチ数列 Hard
ユーザー letrangerjpletrangerjp
提出日時 2018-03-02 22:39:44
言語 Ruby
(3.3.0)
結果
AC  
実行時間 124 ms / 2,000 ms
コード長 153 bytes
コンパイル時間 401 ms
コンパイル使用メモリ 11,376 KB
実行使用メモリ 17,244 KB
最終ジャッジ日時 2023-09-04 04:29:23
合計ジャッジ時間 2,764 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 85 ms
15,820 KB
testcase_01 AC 85 ms
15,908 KB
testcase_02 AC 85 ms
15,660 KB
testcase_03 AC 85 ms
15,616 KB
testcase_04 AC 122 ms
16,304 KB
testcase_05 AC 123 ms
16,608 KB
testcase_06 AC 123 ms
16,388 KB
testcase_07 AC 122 ms
16,408 KB
testcase_08 AC 124 ms
16,552 KB
testcase_09 AC 124 ms
17,244 KB
testcase_10 AC 123 ms
17,044 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

$dp = [0,0,0,1]
Q = gets.to_i
N = $<.map &:to_i

(4...4912).each{|i|
  $dp[i] = (1..4).map{|j| $dp[i - j]}.sum % 17
}
N.each{|n|
  p $dp[(n-1) % 4912]
}
0