結果
| 問題 |
No.2782 メルセンヌ数総乗
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2024-07-21 00:54:41 |
| 言語 | Common Lisp (sbcl 2.5.0) |
| 結果 |
AC
|
| 実行時間 | 17 ms / 2,000 ms |
| コード長 | 709 bytes |
| コンパイル時間 | 1,034 ms |
| コンパイル使用メモリ | 27,008 KB |
| 実行使用メモリ | 24,320 KB |
| 最終ジャッジ日時 | 2024-07-21 00:54:44 |
| 合計ジャッジ時間 | 2,682 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
| 外部呼び出し有り |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 20 |
コンパイルメッセージ
; compiling file "/home/judge/data/code/Main.lisp" (written 21 JUL 2024 12:54:41 AM): ; wrote /home/judge/data/code/Main.fasl ; compilation finished in 0:00:00.024
ソースコード
#-swank
(unless (member :child-sbcl *features*)
(quit
:recklessly-p t
:unix-status
(process-exit-code
(run-program *runtime-pathname*
`("--control-stack-size" "1024MB"
"--noinform" "--disable-ldb" "--lose-on-corruption" "--end-runtime-options"
"--eval" "(push :child-sbcl *features*)"
"--script" ,(namestring *load-pathname*))
:output t :error t :input t))))
(defun main ()
(let* ((N (read))
(answer 1)
(MOD (1- (ash 1 (1+ N)))))
(loop for i from 2 to N do
(setf answer (mod (* answer (1- (ash 1 i))) MOD)))
(format t "~A~%" (if (= answer 0) "Yes" "No"))))
(main)