結果

問題 No.26 シャッフルゲーム
コンテスト
ユーザー まんしmaNNshi
提出日時 2025-03-23 13:09:09
言語 Common Lisp
(sbcl 2.6.3)
コンパイル:
sbclc _filename_
実行:
sbcl --script Main.fasl
結果
AC  
実行時間 6 ms / 5,000 ms
コード長 581 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 125 ms
コンパイル使用メモリ 35,584 KB
実行使用メモリ 27,384 KB
最終ジャッジ日時 2026-07-07 20:45:23
合計ジャッジ時間 1,374 ms
ジャッジサーバーID
(参考情報)
judge3_1 / judge2_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 10
権限があれば一括ダウンロードができます
コンパイルメッセージ
; compiling file "/home/judge/data/code/Main.lisp" (written 07 JUL 2026 08:45:21 PM):

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

ソースコード

diff #
raw source code

(defparameter N (parse-integer (read-line)))
(defparameter M (parse-integer (read-line)))

(defvar cup)
(setq cup (make-array 4 :initial-element nil))
(setf (aref cup N) T)

(defvar p)
(defvar q)
(defvar temp)
(loop for line = (read-line nil nil) while line do
 ;(print line)

 (setq p (digit-char-p (aref line 0)))
 (setq q (digit-char-p (aref line 2)))
 (setq temp (aref cup p))
 (setf (aref cup p) (aref cup q))
 (setf (aref cup q) temp)
 ;(format 't "<~a>~%" cup )
)
 (if (aref cup 1) (format 't "1~%"))
 (if (aref cup 2) (format 't "2~%"))
 (if (aref cup 3) (format 't "3~%"))
0