結果

問題 No.658 テトラナッチ数列 Hard
ユーザー horiesiniti
提出日時 2018-03-14 18:11:55
言語 Ruby
(3.4.1)
結果
AC  
実行時間 101 ms / 2,000 ms
コード長 250 bytes
コンパイル時間 227 ms
コンパイル使用メモリ 7,552 KB
実行使用メモリ 12,672 KB
最終ジャッジ日時 2024-11-28 07:14:59
合計ジャッジ時間 2,644 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 8
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.rb:2: warning: assigned but unused variable - no
Syntax OK

ソースコード

diff #

hs={}
no=2
ts=[]
ts<<0
ts<<0
ts<<0
t1=0
t2=0
t3=0
t4=1
while hs.key?([t1,t2,t3,t4])==false
	ts<<t4
	hs[[t1,t2,t3,t4]]=0
	n=t4+t3+t2+t1
	t1=t2%17
	t2=t3%17
	t3=t4%17
	t4=n%17

end
ts.pop
ts.pop
ts.pop
gets.to_i.times{
	puts ts[(gets.to_i-1)%ts.size]
}
0