結果

問題 No.64 XORフィボナッチ数列
ユーザー Takuya NoguchiTakuya Noguchi
提出日時 2018-03-28 22:22:44
言語 Ruby
(3.3.0)
結果
TLE  
実行時間 -
コード長 214 bytes
コンパイル時間 170 ms
コンパイル使用メモリ 11,264 KB
実行使用メモリ 19,552 KB
最終ジャッジ日時 2023-09-07 19:34:30
合計ジャッジ時間 7,779 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 79 ms
19,504 KB
testcase_01 AC 78 ms
15,124 KB
testcase_02 AC 82 ms
15,152 KB
testcase_03 AC 78 ms
15,052 KB
testcase_04 AC 82 ms
15,132 KB
testcase_05 AC 77 ms
15,136 KB
testcase_06 AC 79 ms
15,236 KB
testcase_07 AC 79 ms
15,136 KB
testcase_08 AC 78 ms
15,004 KB
testcase_09 TLE -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

prev, current, N = gets.split.map(&:to_i)
answer = nil

if N.zero? or N == 1
  puts N.zero? ? prev : current
  exit
end

(N - 1).times do
  answer = prev ^ current
  prev, current = current, answer
end

puts answer
0