結果

問題 No.1764 Square
ユーザー motoshiramotoshira
提出日時 2021-11-27 00:02:19
言語 Common Lisp
(sbcl 2.3.8)
結果
AC  
実行時間 10 ms / 2,000 ms
コード長 1,865 bytes
コンパイル時間 1,100 ms
コンパイル使用メモリ 31,792 KB
実行使用メモリ 27,956 KB
最終ジャッジ日時 2023-09-12 05:43:31
合計ジャッジ時間 1,525 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 10 ms
27,856 KB
testcase_01 AC 9 ms
23,884 KB
testcase_02 AC 9 ms
27,884 KB
testcase_03 AC 8 ms
23,872 KB
testcase_04 AC 9 ms
25,924 KB
testcase_05 AC 10 ms
27,956 KB
testcase_06 AC 8 ms
23,916 KB
testcase_07 AC 9 ms
27,948 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
; compiling file "/home/judge/data/code/Main.lisp" (written 12 SEP 2023 05:43:29 AM):
; processing (IN-PACKAGE #:CL-USER)
; processing (DECLAIM (OPTIMIZE # ...))
; processing (DECLAIM (MUFFLE-CONDITIONS COMPILER-NOTE))
; processing (DISABLE-DEBUGGER)
; processing (PUSHNEW :INLINE-GENERIC-FUNCION ...)
; processing (IN-PACKAGE #:CL-USER)
; processing (DECLAIM (INLINE PRINTLN))
; processing (DEFUN PRINTLN ...)
; processing (DEFUN READ-INTO ...)
; processing (DEFUN MAIN ...)
; processing (MAIN)

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

ソースコード

diff #

(in-package #:cl-user)

;;------------------------------Preferences------------------------------

(eval-when (:compile-toplevel :load-toplevel :execute)
  #+swank (declaim (optimize (speed 3) (safety 2)))
  #-swank (declaim (optimize (speed 3) (safety 0) (debug 0)))
  #+swank (load "~/ghq/github.com/motoshira/atcoder-submission/ac-tools/act.lisp")
  #+swank (ql:quickload :prove)
  #-swank (declaim (sb-ext:muffle-conditions sb-ext:compiler-note))
  #-swank (sb-ext:disable-debugger)
  (pushnew :inline-generic-funcion *features*))

;;---------------------------------Body---------------------------------

(in-package #:cl-user)

(declaim (inline println))
(defun println (obj &optional (stream *standard-output*))
  (let ((*read-default-float-format* 'double-float))
    (prog1 obj
      (princ obj stream)
      (terpri stream))))

(defun read-into (count &optional (result-type 'list) (reader #'read))
  (coerce (loop :repeat count :collect (funcall reader)) result-type))

(defun main ()
  (let ((qs (make-array 4 :initial-element nil)))
    (push #\E (aref qs 0))
    (push #\A (aref qs 0))
    (push #\B (aref qs 1))
    (push #\C (aref qs 2))
    (push #\D (aref qs 3))
    (dotimes (i (read))
      (let* ((now (rem i 4))
             (next (rem (1+ now) 4))
             (x (pop (aref qs now))))
        (setf (aref qs next)
              (concatenate 'list
                           (aref qs next)
                           (list x)))))
    (loop :for xs :across qs
          :do (mapc #'princ xs)
              (terpri))))

#-swank (main)

#+swank
(defun run ()
  (let ((*standard-input*
          (make-string-input-stream
           (with-output-to-string (*standard-output*)
             (run-program
              (merge-pathnames "copy-or-paste" (truename "~/bin/"))
              '()
              :output *standard-output*)))))
    (main)))
0