結果
| 問題 |
No.2803 Bocching Star
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2024-07-21 01:02:04 |
| 言語 | Common Lisp (sbcl 2.5.0) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 1,208 bytes |
| コンパイル時間 | 1,304 ms |
| コンパイル使用メモリ | 29,312 KB |
| 実行使用メモリ | 46,336 KB |
| 最終ジャッジ日時 | 2024-07-21 01:02:10 |
| 合計ジャッジ時間 | 4,953 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | TLE * 1 -- * 34 |
コンパイルメッセージ
; compiling file "/home/judge/data/code/Main.lisp" (written 21 JUL 2024 01:02:04 AM): ; wrote /home/judge/data/code/Main.fasl ; compilation finished in 0:00:00.029
ソースコード
#-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)))
(p (append (loop for i from 0 below N collect (list (nth i P) (1+ i)))
(list (list most-negative-fixnum -1) (list most-positive-fixnum -1)))))
(setf p (sort p #'< :key #'first))
(let ((ans (loop for i from 1 to N
for near = (min (- (first (nth i p)) (first (nth (1- i) p)))
(- (first (nth (1+ i) p)) (first (nth i p))))
if (> near S) collect (second (nth i p)))))
(setf ans (sort ans #'<))
(format t "~D~%" (length ans))
(dolist (elem ans)
(format t "~D " elem))
(terpri))))
(main)