結果

問題 No.313 π
ユーザー Common Lisp
提出日時 2024-11-13 01:25:12
言語 Common Lisp
(sbcl 2.5.0)
結果
AC  
実行時間 19 ms / 5,000 ms
コード長 669 bytes
コンパイル時間 301 ms
コンパイル使用メモリ 39,548 KB
実行使用メモリ 34,472 KB
最終ジャッジ日時 2024-11-13 01:25:15
合計ジャッジ時間 2,523 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 32
権限があれば一括ダウンロードができます
コンパイルメッセージ
; compiling file "/home/judge/data/code/Main.lisp" (written 13 NOV 2024 01:25:12 AM):

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

ソースコード

diff #

(defun main (&rest argv)
  (declare (ignorable argv))
  (let* ((*read-default-float-format* 'double-float)
         (s (read-line))
         (tbl-0-9 (make-array 10 :initial-contents '(20104 20063 19892 20011 19874 20199 19898 20163 19956 19841)))
         (counter (make-array 10 :element-type 'integer :initial-element 0)))
    (loop for c across s
          when (char/= #\. c)
            do (incf (aref counter (- (char-code c) (char-code #\0)))))
    (dotimes (i 10)
      (when (> (aref counter i) (aref tbl-0-9 i))
            (format t "~d " i)))
    (dotimes (i 10)
      (when (< (aref counter i) (aref tbl-0-9 i))
            (format t "~d~%" i)))))

(main)
0