結果
| 問題 | No.1237 EXP Multiple! |
| コンテスト | |
| ユーザー |
motoshira
|
| 提出日時 | 2020-10-14 22:07:07 |
| 言語 | Common Lisp (sbcl 2.5.0) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 611 bytes |
| 記録 | |
| コンパイル時間 | 1,354 ms |
| コンパイル使用メモリ | 24,832 KB |
| 実行使用メモリ | 24,704 KB |
| 最終ジャッジ日時 | 2024-07-20 19:30:42 |
| 合計ジャッジ時間 | 2,869 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | RE * 1 |
| other | RE * 19 |
コンパイルメッセージ
; compiling file "/home/judge/data/code/Main.lisp" (written 20 JUL 2024 07:30:39 PM):
;
; caught ERROR:
; READ error during COMPILE-FILE:
;
; end of file on #<SB-INT:FORM-TRACKING-STREAM for "file /home/judge/data/code/Main.lisp" {10011A09F3}>
;
; (in form starting at line: 3, column: 0, position: 33)
;
; compilation unit aborted
; caught 1 fatal ERROR condition
; caught 1 ERROR condition
; compilation aborted after 0:00:00.005
ソースコード
(defparameter *mod* 1000000007)
(defun fact (x)
(if (zerop x)
1
(* x (fact (1- x))))
(defun main ()
(let ((n (read)))
(let ((a (loop repeat n collect (read))))
(princ (if (some #'zerop a)
-1
(if (every (lambda (x)
(<= 1 x 3))
a)
(mod *mod* (reduce #'*
(mapcar (lambda (x)
(expt x (fact x)))
a)))
0))))))
(main)
motoshira