結果
| 問題 |
No.933 おまわりさんこいつです
|
| コンテスト | |
| ユーザー |
Common Lisp
|
| 提出日時 | 2024-11-10 03:19:02 |
| 言語 | Common Lisp (sbcl 2.5.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 455 bytes |
| コンパイル時間 | 949 ms |
| コンパイル使用メモリ | 27,776 KB |
| 実行使用メモリ | 22,912 KB |
| 最終ジャッジ日時 | 2024-11-10 03:19:05 |
| 合計ジャッジ時間 | 2,442 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 24 WA * 1 |
コンパイルメッセージ
; compiling file "/home/judge/data/code/Main.lisp" (written 10 NOV 2024 03:19:02 AM): ; wrote /home/judge/data/code/Main.fasl ; compilation finished in 0:00:00.145
ソースコード
(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 (reduce #'(lambda (x acc) (mod (* x acc) 9)) p)))
(format t "~d~%" (if (zerop r)
9
r)))))
(main)
Common Lisp