結果

問題 No.64 XORフィボナッチ数列
ユーザー zazaboonzazaboon
提出日時 2017-02-06 00:53:09
言語 Ruby
(3.3.0)
結果
AC  
実行時間 77 ms / 5,000 ms
コード長 269 bytes
コンパイル時間 76 ms
コンパイル使用メモリ 11,444 KB
実行使用メモリ 15,356 KB
最終ジャッジ日時 2023-08-25 22:51:39
合計ジャッジ時間 1,870 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 71 ms
15,052 KB
testcase_01 AC 72 ms
15,120 KB
testcase_02 AC 70 ms
15,156 KB
testcase_03 AC 67 ms
15,120 KB
testcase_04 AC 67 ms
15,084 KB
testcase_05 AC 67 ms
15,048 KB
testcase_06 AC 76 ms
15,156 KB
testcase_07 AC 77 ms
15,252 KB
testcase_08 AC 76 ms
15,296 KB
testcase_09 AC 69 ms
15,340 KB
testcase_10 AC 68 ms
15,340 KB
testcase_11 AC 69 ms
15,356 KB
testcase_12 AC 69 ms
15,244 KB
testcase_13 AC 67 ms
15,144 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.rb:6: warning: assigned but unused variable - p
Syntax OK

ソースコード

diff #

mf0,mf1,n = gets.chomp.split(" ").map(&:to_i)
f0 = mf0
f1 = mf1  
a = 0
i = 0
p = 0
while(1 <= f0 or 1 <= f1)
if((f0%2+f1%2) == 1)
  a += 2**i
end
  f0 /= 2
  f1 /= 2
  i += 1
end
if(n%3 == 0)
  puts mf0 
elsif(n%3 == 1)
  puts mf1
else
  puts a
end
=begin
88 79 2
=end
0