結果
| 問題 | No.2774 Wake up Record 2 |
| コンテスト | |
| ユーザー |
Common Lisp
|
| 提出日時 | 2024-10-21 21:55:55 |
| 言語 | Common Lisp (sbcl 2.6.3) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 589 bytes |
| 記録 | |
| コンパイル時間 | 174 ms |
| コンパイル使用メモリ | 34,580 KB |
| 実行使用メモリ | 35,040 KB |
| 最終ジャッジ日時 | 2026-05-05 18:07:49 |
| 合計ジャッジ時間 | 6,260 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge2_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 10 TLE * 1 -- * 5 |
コンパイルメッセージ
; compiling file "/home/judge/data/code/Main.lisp" (written 05 MAY 2026 06:07:30 PM): ; wrote /home/judge/data/code/Main.fasl ; compilation finished in 0:00:00.006
ソースコード
(defun main (&rest argv)
(declare (ignorable argv))
(let* ((n (read))
(k (read))
(a (loop repeat n collect (read)))
(b (sort (copy-list a) #'<))
(x (nth (1- k) b))
(l ()))
(loop for i from 0 below n
do (push (if (<= (nth i a) x) #\x #\o) l))
(setf l (reverse l))
(let ((ans ()))
(loop for i from 0 below (1- n)
when (and (char= (nth i l) #\x)
(char= (nth (1+ i) l) #\o))
do (push (+ 2 i) ans))
(format t "~a~%~{~a~^ ~}~%" (length ans) (reverse ans)))))
(main)
Common Lisp