結果
| 問題 |
No.657 テトラナッチ数列 Easy
|
| コンテスト | |
| ユーザー |
horiesiniti
|
| 提出日時 | 2018-03-12 09:10:43 |
| 言語 | Ruby (3.4.1) |
| 結果 |
AC
|
| 実行時間 | 115 ms / 2,000 ms |
| コード長 | 250 bytes |
| コンパイル時間 | 45 ms |
| コンパイル使用メモリ | 7,552 KB |
| 実行使用メモリ | 12,672 KB |
| 最終ジャッジ日時 | 2024-11-07 00:16:28 |
| 合計ジャッジ時間 | 2,899 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 13 |
コンパイルメッセージ
Main.rb:2: warning: assigned but unused variable - no Syntax OK
ソースコード
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]
}
horiesiniti