結果

問題 No.1373 Directed Operations
ユーザー linuxmetel
提出日時 2021-02-05 21:56:22
言語 Common Lisp
(sbcl 2.5.0)
結果
WA  
実行時間 -
コード長 656 bytes
コンパイル時間 60 ms
コンパイル使用メモリ 28,032 KB
実行使用メモリ 25,088 KB
最終ジャッジ日時 2024-07-02 12:27:12
合計ジャッジ時間 4,543 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 12 WA * 7
権限があれば一括ダウンロードができます
コンパイルメッセージ
; compiling file "/home/judge/data/code/Main.lisp" (written 02 JUL 2024 12:27:07 PM):

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

ソースコード

diff #

(defvar n (read))

(defparameter a (sort (apply #'vector -100000000 (loop repeat (1- n)
                                                       collect (read))) #'<))

(defvar f nil)                                         
(loop for i from 1 to (1- n) 
      until f             
      do (unless (<= (aref a i) i)
           (setq f t)))   

(if f                                    
    (progn (princ "NO")
           (fresh-line))                 
    (progn (princ "YES")
           (fresh-line)                  
           (loop for i from 1 to (1- n) 
                 do (princ (1+ (- i (aref a i))))
                    (fresh-line)))) 
;(princ a)
0