結果
問題 | No.314 ケンケンパ |
ユーザー |
|
提出日時 | 2016-02-02 21:42:31 |
言語 | Ruby (3.4.1) |
結果 |
AC
|
実行時間 | 175 ms / 1,000 ms |
コード長 | 272 bytes |
コンパイル時間 | 424 ms |
コンパイル使用メモリ | 7,552 KB |
実行使用メモリ | 12,288 KB |
最終ジャッジ日時 | 2024-09-21 20:04:34 |
合計ジャッジ時間 | 3,121 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 17 |
コンパイルメッセージ
Main.rb:9: warning: assigned but unused variable - r Syntax OK
ソースコード
@lim=(7+1e9).to_i@memo={}def calc(x)return [1,1,2][x] if x<3k1=1k2=1k3=2r=0(x).times{|i|t3 = (k1 + k2)%@limt2 = k3t1 = k2k1=t1k2=t2k3=t3}return k1%@limendp calc(gets.to_i)