結果

問題 No.112 ややこしい鶴亀算
ユーザー まんしmaNNshi
提出日時 2025-04-29 18:56:14
言語 Common Lisp
(sbcl 2.5.0)
結果
WA  
実行時間 -
コード長 927 bytes
コンパイル時間 375 ms
コンパイル使用メモリ 31,468 KB
実行使用メモリ 27,800 KB
最終ジャッジ日時 2025-04-29 18:56:18
合計ジャッジ時間 1,743 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1 WA * 1
other AC * 14 WA * 9
権限があれば一括ダウンロードができます
コンパイルメッセージ
; compiling file "/home/judge/data/code/Main.lisp" (written 29 APR 2025 06:56:14 PM):

; file: /home/judge/data/code/Main.lisp
; in: IF (= SMALL BIG)
;     (HIKI 0)
; 
; caught STYLE-WARNING:
;   The variable HIKI is defined but never used.
; 
; compilation unit finished
;   caught 1 STYLE-WARNING condition


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

ソースコード

diff #

(defparameter x (make-hash-table))


(defparameter N (parse-integer (read-line)))
(defparameter a (read-from-string (concatenate 'string "(" (read-line) ")" )))

(defparameter big 0)
(defparameter small 0)

(loop for i in a do

        (if (null (gethash i x)) (setf (gethash i x) 1) (setf (gethash i x) (+ (gethash i x) 1)))


        (if (= small 0) (setq small i)
                (if (< small i) (setq big i)
                        (if (> small i)
                                (progn (setq big small) (setq small i)))))


)


;(print (gethash 2 x))
;(print (gethash 4 x))

;(format t "small=~d big=~d N=~d~%" small big N)

(if (= small big)

                                   (let ((hiki 0))
                                        (if (= (/ small 4) (- N 1))

(format t "~d ~d~%"  0 N)
(format t "~d ~d~%"  N 0)
)





                                   )




(format t "~d ~d~%" (gethash big x) (gethash small x))
)

0