結果

問題 No.123 カードシャッフル
ユーザー まんしmaNNshi
提出日時 2025-04-20 21:34:25
言語 Common Lisp
(sbcl 2.5.0)
結果
AC  
実行時間 86 ms / 5,000 ms
コード長 518 bytes
コンパイル時間 1,770 ms
コンパイル使用メモリ 32,992 KB
実行使用メモリ 34,316 KB
最終ジャッジ日時 2025-04-20 21:34:29
合計ジャッジ時間 3,270 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 10
権限があれば一括ダウンロードができます
コンパイルメッセージ
; compiling file "/home/judge/data/code/Main.lisp" (written 20 APR 2025 09:34:26 PM):

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

ソースコード

diff #

(defvar temp)
(setq temp (read-from-string (concatenate 'string "(" (read-line) ")")))
(defparameter N (nth 0 temp))
(defparameter M (nth 1 temp))
(defparameter A    (read-from-string (concatenate 'string "(" (read-line) ")")))

(defparameter C (make-array (+ N 1)))
(loop for i from 1 to N do
 	(setf (aref C i) i)
)
;(print C)

(loop for i in A do
 	(setq temp (aref C i))
	(loop for j from i downto 2 do
		(setf (aref C j) (aref C (- j 1))) 
	)
	(setf (aref C 1) temp)
	;(print C)
)
	 	
(format t "~d~%" (aref C 1))
0