結果

問題 No.933 おまわりさんこいつです
コンテスト
ユーザー Common Lisp
提出日時 2024-11-10 03:26:16
言語 Common Lisp
(sbcl 2.6.3)
コンパイル:
sbclc _filename_
実行:
sbcl --script Main.fasl
結果
AC  
実行時間 114 ms / 2,000 ms
コード長 547 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 169 ms
コンパイル使用メモリ 30,208 KB
実行使用メモリ 23,296 KB
最終ジャッジ日時 2026-05-09 12:39:39
合計ジャッジ時間 3,605 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge2_1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 25
権限があれば一括ダウンロードができます
コンパイルメッセージ
; compiling file "/home/judge/data/code/Main.lisp" (written 09 MAY 2026 12:39:31 PM):

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

ソースコード

diff #
raw source code

(defun main (&rest argv)
  (declare (ignorable argv))
  (let* ((n (read))
         (p (make-array n :element-type 'integer)))
    (dotimes (i n)
      (let* ((q (read)))
        (if (zerop q)
            (progn
             (format t "0~%")
             (return-from main 0))
            (setf (aref p i) q))))
    (let ((r (if (= n 1)
                 (mod (aref p 0) 9)
                 (reduce #'(lambda (x acc) (mod (* x acc) 9)) p))))
      (format t "~d~%" (if (zerop r)
                           9
                           r)))))

(main)
0