結果

問題 No.2803 Bocching Star
ユーザー Lisp_CoderLisp_Coder
提出日時 2024-07-21 01:02:49
言語 Common Lisp
(sbcl 2.3.8)
結果
TLE  
実行時間 -
コード長 1,265 bytes
コンパイル時間 246 ms
コンパイル使用メモリ 29,696 KB
実行使用メモリ 46,080 KB
最終ジャッジ日時 2024-07-21 01:02:54
合計ジャッジ時間 4,467 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 13 ms
46,080 KB
testcase_01 AC 13 ms
29,696 KB
testcase_02 AC 13 ms
24,192 KB
testcase_03 TLE -
testcase_04 -- -
testcase_05 -- -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
testcase_28 -- -
testcase_29 -- -
testcase_30 -- -
testcase_31 -- -
testcase_32 -- -
testcase_33 -- -
testcase_34 -- -
testcase_35 -- -
testcase_36 -- -
testcase_37 -- -
権限があれば一括ダウンロードができます
コンパイルメッセージ
; compiling file "/home/judge/data/code/Main.lisp" (written 21 JUL 2024 01:02:49 AM):

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

ソースコード

diff #

#-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))
         (S (read))
         (P (loop for i from 0 below N collect (read)))
         (sorted-p (sort (mapcar #'(lambda (x i) (list x (1+ i))) P (loop for i from 0 below N collect i))
                         #'< :key #'first))
         (result '()))
    (loop for i from 0 below N
          for (value index) = (nth i sorted-p)
          for left = (if (> i 0) (- value (first (nth (1- i) sorted-p))) most-positive-fixnum)
          for right = (if (< i (1- N)) (- (first (nth (1+ i) sorted-p)) value) most-positive-fixnum)
          for near = (min left right)
          when (> near S) do (push index result))
    (setf result (sort result #'<))
    (format t "~D~%" (length result))
    (dolist (elem result)
      (format t "~D " elem))
    (terpri)))

(main)
0