結果
| 問題 | No.32 貯金箱の憂鬱 | 
| コンテスト | |
| ユーザー |  Common Lisp | 
| 提出日時 | 2024-10-06 21:22:41 | 
| 言語 | Common Lisp (sbcl 2.5.0) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 10 ms / 5,000 ms | 
| コード長 | 603 bytes | 
| コンパイル時間 | 1,193 ms | 
| コンパイル使用メモリ | 33,808 KB | 
| 実行使用メモリ | 21,632 KB | 
| 最終ジャッジ日時 | 2024-10-06 21:22:43 | 
| 合計ジャッジ時間 | 2,011 ms | 
| ジャッジサーバーID (参考情報) | judge3 / judge1 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | AC * 12 | 
コンパイルメッセージ
; compiling file "/home/judge/data/code/Main.lisp" (written 06 OCT 2024 09:22:40 PM): ; wrote /home/judge/data/code/Main.fasl ; compilation finished in 0:00:00.014
ソースコード
; 貯金箱内の合計金額を求めて 1000 で割ったあまり b1000 を求める
; b1000 を 100 で割った商と剰余を記録 -> a100 b100
; b100 を 25 で割った商と剰余を記録 -> a25 b25
; 答えは a100 + a25 + b25 である
(defun main ()
  (let* ((l (read))
         (m (read))
         (n (read))
         (total (+ (* l 100) (* m 25) (* n 1)))
         (b1000 (mod total 1000))
         (a100 (floor b1000 100))
         (b100 (mod b1000 100))
         (a25 (floor b100 25))
         (b25 (mod b100 25))
         (ans (+ a100 a25 b25)))
    (princ ans)
    (terpri)))
(main)
            
            
            
        