結果
問題 |
No.112 ややこしい鶴亀算
|
ユーザー |
|
提出日時 | 2025-04-29 19:01:48 |
言語 | Common Lisp (sbcl 2.5.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 928 bytes |
コンパイル時間 | 388 ms |
コンパイル使用メモリ | 35,524 KB |
実行使用メモリ | 27,668 KB |
最終ジャッジ日時 | 2025-04-29 19:01:50 |
合計ジャッジ時間 | 1,776 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 18 WA * 5 |
コンパイルメッセージ
; compiling file "/home/judge/data/code/Main.lisp" (written 29 APR 2025 07:01:48 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.008
ソースコード
(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)) )