結果

問題 No.5 数字のブロック
ユーザー ldsyb
提出日時 2016-05-19 15:54:11
言語 Scheme
(Gauche-0.9.15)
結果
RE  
実行時間 -
コード長 316 bytes
コンパイル時間 196 ms
コンパイル使用メモリ 7,072 KB
実行使用メモリ 17,280 KB
最終ジャッジ日時 2024-10-06 10:18:03
合計ジャッジ時間 2,446 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 24 RE * 10
権限があれば一括ダウンロードができます

ソースコード

diff #

(define ans 0)
(define l (read))
(define n (read))
(define w (list))
(let loop((i n))
	(set! w (cons (read) w))
	(if (> i 1) (loop (- i 1))))
(set! w (sort w))
(define (solve ls)
	(if (>= l (car ls))
		(begin
			(set! ans (+ ans 1))
			(set! l (- l (car ls)))
			(solve (cdr ls)))))
(solve w)
(display ans)
(newline)
0