結果

問題 No.32 貯金箱の憂鬱
ユーザー MiyamonYMiyamonY
提出日時 2019-09-03 15:56:50
言語 Scheme
(Gauche-0.9.14)
結果
RE  
実行時間 -
コード長 683 bytes
コンパイル時間 63 ms
コンパイル使用メモリ 5,300 KB
実行使用メモリ 11,932 KB
最終ジャッジ日時 2023-08-25 18:48:57
合計ジャッジ時間 7,791 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 533 ms
11,800 KB
testcase_01 AC 531 ms
11,900 KB
testcase_02 AC 530 ms
11,912 KB
testcase_03 AC 531 ms
11,908 KB
testcase_04 AC 532 ms
11,712 KB
testcase_05 AC 532 ms
11,896 KB
testcase_06 AC 530 ms
11,884 KB
testcase_07 AC 530 ms
11,732 KB
testcase_08 RE -
testcase_09 RE -
testcase_10 AC 532 ms
11,808 KB
testcase_11 AC 530 ms
11,932 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

(define (read-number)
  (string->number (read-line)))


(let* ((l (read-number))
       (m (read-number))
       (n (read-number))
       (total (+ n (* m 25) (* l 100))))

  (define pat '())
  (let loop-n1 ((n1 0))
    (cond ((< n1 50)
	   (let loop-n25 ((n25 0))
	     (cond ((< n25 50)
		    (let loop-n100 ((n100 0))
		      (cond ((< n100 50)
			     (let loop-n1000 ((n1000 0))
			       (cond ((< n1000 50)
				      (cond ((= total (+ n1 (* n25 25) (* n100 100) (* n1000 1000)))
					     (push! pat (+ n1 n25 n100))))
				      (loop-n1000 (+ n1000 1)))))
			     (loop-n100 (+ n100 1)))))
		    (loop-n25 (+ n25 1)))))
	   (loop-n1 (+ n1 1)))))

  (print (apply min pat)))
0