結果

問題 No.5 数字のブロック
ユーザー neko_the_shadow
提出日時 2016-08-19 23:43:05
言語 Scheme
(Gauche-0.9.15)
結果
WA  
実行時間 -
コード長 421 bytes
コンパイル時間 74 ms
コンパイル使用メモリ 6,820 KB
実行使用メモリ 17,920 KB
最終ジャッジ日時 2024-11-07 19:05:37
合計ジャッジ時間 2,848 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 4 WA * 30
権限があれば一括ダウンロードができます

ソースコード

diff #

(define (solve l w)
    (let loop ((ls w) (cnt 0) (sum 0))
        (if (or (null? ls) (< l (+ (car ls) sum)))
            cnt
            (loop (cdr ls) (+ cnt 1) (+ sum (car ls))))))

(define (MAIN)
    (let ((l (string->number (read-line)))
          (n (string->number (read-line)))
          (w (sort (map string->number
                        (string-split (read-line) " ")))))
        (print (solve l w))))

(MAIN)
0