結果
問題 | No.412 花火大会 |
ユーザー |
![]() |
提出日時 | 2024-11-13 19:00:07 |
言語 | Common Lisp (sbcl 2.5.0) |
結果 |
AC
|
実行時間 | 14 ms / 2,000 ms |
コード長 | 851 bytes |
コンパイル時間 | 399 ms |
コンパイル使用メモリ | 60,304 KB |
実行使用メモリ | 22,144 KB |
最終ジャッジ日時 | 2024-11-13 19:00:09 |
合計ジャッジ時間 | 1,937 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 18 |
コンパイルメッセージ
; compiling file "/home/judge/data/code/Main.lisp" (written 13 NOV 2024 07:00:07 PM): ; wrote /home/judge/data/code/Main.fasl ; compilation finished in 0:00:00.074
ソースコード
(defun main (&rest argv) (declare (ignorable argv)) (let* ((b (read)) (c (read)) (d (read)) (n (read)) (a (sort (make-array 3 :initial-contents (list b c d)) #'<)) (e (make-array n :element-type 'integer)) (res 0)) (dotimes (i n) (setf (aref e i) (read))) (sort e #'<) (loop for i from (1- n) downto 2 when (>= (aref e i) (aref a 2)) do (loop for j from (1- i) downto 1 when (>= (aref e j) (aref a 1)) do (loop for k from (1- j) downto 0 when (>= (aref e k) (aref a 0)) do (let ((f 1)) (dotimes (l k) (setq f (* f 2))) (incf res f))))) (format t "~d~%" res))) (main)