結果

問題 No.657 テトラナッチ数列 Easy
ユーザー nonokai10nonokai10
提出日時 2018-03-11 12:26:17
言語 Ruby
(3.3.0)
結果
MLE  
実行時間 -
コード長 191 bytes
コンパイル時間 187 ms
コンパイル使用メモリ 7,552 KB
実行使用メモリ 817,792 KB
最終ジャッジ日時 2024-04-23 01:00:02
合計ジャッジ時間 2,934 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 84 ms
12,288 KB
testcase_01 AC 80 ms
12,160 KB
testcase_02 AC 73 ms
12,288 KB
testcase_03 AC 74 ms
12,288 KB
testcase_04 MLE -
testcase_05 -- -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

a = []
gets.to_i.times do
  a << gets.to_i
end
tetra = (4..a.max-1).inject([0, 0, 0, 1]){|tetra, i| tetra << tetra[i-1] + tetra[i-2] + tetra[i-3] + tetra[i-4]}
puts a.map{|i| tetra[i-1] % 17}
0