結果

問題 No.5 数字のブロック
ユーザー MiyamonY
提出日時 2019-09-03 01:21:30
言語 Scheme
(Gauche-0.9.15)
結果
AC  
実行時間 47 ms / 5,000 ms
コード長 319 bytes
コンパイル時間 312 ms
コンパイル使用メモリ 6,948 KB
実行使用メモリ 17,664 KB
最終ジャッジ日時 2024-12-18 01:04:21
合計ジャッジ時間 3,240 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 34
権限があれば一括ダウンロードができます

ソースコード

diff #

(define (solve l arr)
  (if (or (null? arr) (< l (car arr)))
      0
      (let ((top (car arr)))
	(+ 1 (solve (- l top) (cdr arr))))))

(let* ((l (string->number (read-line)))
       (n (string->number (read-line)))
       (arr (map string->number (string-split (read-line) #\space))))
  (print (solve l (sort arr))))
0