結果

問題 No.64 XORフィボナッチ数列
コンテスト
ユーザー まんしmaNNshi
提出日時 2025-04-05 11:56:05
言語 Common Lisp
(sbcl 2.6.3)
コンパイル:
sbclc _filename_
実行:
sbcl --script Main.fasl
結果
WA  
実行時間 -
コード長 384 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 15 ms
コンパイル使用メモリ 27,904 KB
実行使用メモリ 19,712 KB
最終ジャッジ日時 2026-07-08 11:52:18
合計ジャッジ時間 1,555 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge2_1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 9 WA * 2
権限があれば一括ダウンロードができます
コンパイルメッセージ
; compiling file "/home/judge/data/code/Main.lisp" (written 08 JUL 2026 11:52:16 AM):

; file: /home/judge/data/code/Main.lisp
; in: FORMAT T
;     (CASE N (0 F0) (1 F1) (OTHERWISE F1))
; --> COND IF IF THE 
; ==>
;   F1
; 
; note: deleting unreachable code
; 
; compilation unit finished
;   printed 1 note


; wrote /home/judge/data/code/Main.fasl
; compilation finished in 0:00:00.004

ソースコード

diff #
raw source code

(defvar F0)
(defvar F1)
(defvar N)
(defvar temp)
(setq temp (read-from-string (concatenate 'string "(" (read-line) ")")))

(setq F0 (nth 0 temp))
(setq F1 (nth 1 temp))
(setq N  (nth 2 temp))
;(format t "~d ~d~%" N M)

(setq temp 0)
(loop for i from 2 to (mod N 3) do
	(setq temp f1)
	(setq f1 (logxor f0 f1) )
	(setq f0 temp))
(format t "~d~%" (case N (0 F0) (1 F1) (otherwise f1)))
0