結果
| 問題 | No.428 小数から逃げる夢 |
| コンテスト | |
| ユーザー |
Common Lisp
|
| 提出日時 | 2024-11-08 20:52:14 |
| 言語 | Common Lisp (sbcl 2.6.3) |
| 結果 |
AC
|
| 実行時間 | 7 ms / 1,000 ms |
| コード長 | 810 bytes |
| 記録 | |
| コンパイル時間 | 967 ms |
| コンパイル使用メモリ | 30,464 KB |
| 実行使用メモリ | 22,400 KB |
| 最終ジャッジ日時 | 2026-05-08 23:17:47 |
| 合計ジャッジ時間 | 4,038 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge2_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 100 |
コンパイルメッセージ
; compiling file "/home/judge/data/code/Main.lisp" (written 08 MAY 2026 11:17:38 PM): ; wrote /home/judge/data/code/Main.fasl ; compilation finished in 0:00:00.050
ソースコード
(defconstant +d+ "01234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991")
(defun main (&rest argv)
(declare (ignorable argv))
(let* ((n (read))
(a (make-array 191 :element-type 'integer :initial-element 0))
(b (make-array 192 :element-type 'integer :initial-element 0)))
(loop for i to 190 do
(setf (aref a i) (- (char-code (char +d+ i)) (char-code #\0))))
(loop for i from 190 downto 0 do
(setf (aref b i) (+ (* (aref a i) n) (floor (- (aref b (1+ i)) (mod (aref b (1+ i)) 10)) 10))))
(format t "~d." (aref b 0))
(loop for i from 1 to 190 do
(format t "~d" (mod (aref b i) 10)))
(terpri)))
(main)
Common Lisp