結果

問題 No.657 テトラナッチ数列 Easy
ユーザー 👑 horiesinitihoriesiniti
提出日時 2018-03-12 09:10:43
言語 Ruby
(3.3.0)
結果
AC  
実行時間 107 ms / 2,000 ms
コード長 250 bytes
コンパイル時間 59 ms
コンパイル使用メモリ 7,552 KB
実行使用メモリ 12,800 KB
最終ジャッジ日時 2024-04-24 15:41:24
合計ジャッジ時間 2,505 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 98 ms
12,416 KB
testcase_01 AC 87 ms
12,288 KB
testcase_02 AC 84 ms
12,416 KB
testcase_03 AC 88 ms
12,288 KB
testcase_04 AC 82 ms
12,544 KB
testcase_05 AC 100 ms
12,544 KB
testcase_06 AC 88 ms
12,416 KB
testcase_07 AC 91 ms
12,416 KB
testcase_08 AC 90 ms
12,288 KB
testcase_09 AC 102 ms
12,800 KB
testcase_10 AC 99 ms
12,544 KB
testcase_11 AC 99 ms
12,544 KB
testcase_12 AC 104 ms
12,800 KB
testcase_13 AC 107 ms
12,544 KB
testcase_14 AC 106 ms
12,544 KB
testcase_15 AC 102 ms
12,544 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
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