結果

問題 No.701 ひとりしりとり
コンテスト
ユーザー Common Lisp
提出日時 2024-11-03 10:51:43
言語 Common Lisp
(sbcl 2.6.3)
コンパイル:
sbclc _filename_
実行:
sbcl --script Main.fasl
結果
AC  
実行時間 120 ms / 2,000 ms
コード長 746 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 197 ms
コンパイル使用メモリ 37,120 KB
実行使用メモリ 47,872 KB
最終ジャッジ日時 2026-05-06 02:05:52
合計ジャッジ時間 1,955 ms
ジャッジサーバーID
(参考情報)
judge1_1 / judge2_1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 12
権限があれば一括ダウンロードができます
コンパイルメッセージ
; compiling file "/home/judge/data/code/Main.lisp" (written 06 MAY 2026 02:05:49 AM):

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

ソースコード

diff #
raw source code

(defun main (&rest argv)
  (declare (ignorable argv))
  (let* ((n (read))
         (alphabet (make-array 26 :initial-contents '("a" "b" "c" "d" "e" "f" "g" "h" "i" "j" "k" "l" "m" "n" "o" "p" "q" "r" "s" "t" "u" "v" "w" "x" "y" "z")))
         (word-array (make-array (* 26 26 26 26) :element-type 'string :initial-element "")))
    (dotimes (a 26)
      (dotimes (b 26)
        (dotimes (c 26)
          (dotimes (d 26)
            (setf (aref word-array (+ (* 26 26 26 a) (* 26 26 b) (* 26 c) d))
              (concatenate 'string "a" (aref alphabet a) (aref alphabet b) (aref alphabet c) (aref alphabet d) "a"))))))
    (dotimes (i (1- n))
      (format t "~a~%" (aref word-array i)))
    (format t "~an~%" (aref word-array (1- n)))))

(main)
0