結果

問題 No.5 数字のブロック
ユーザー ldsyb
提出日時 2016-05-21 11:16:37
言語 Scheme
(Gauche-0.9.15)
結果
AC  
実行時間 40 ms / 5,000 ms
コード長 322 bytes
コンパイル時間 192 ms
コンパイル使用メモリ 6,952 KB
実行使用メモリ 17,280 KB
最終ジャッジ日時 2024-11-18 08:39:10
合計ジャッジ時間 2,492 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 34
権限があれば一括ダウンロードができます

ソースコード

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))))
(define (solve ls)
	(if (and (pair? ls) (>= l (car ls)))
		(begin
			(set! ans (+ ans 1))
			(set! l (- l (car ls)))
			(solve (cdr ls)))))
(solve (sort w))
(display ans)
(newline)
0