結果

問題 No.5 数字のブロック
コンテスト
ユーザー _Clay____
提出日時 2018-09-16 00:23:29
言語 Scheme
(Gauche-0.9.15)
コンパイル:
true
実行:
gosh _filename_
結果
AC  
実行時間 29 ms / 5,000 ms
+ 738µs
コード長 384 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 3 ms
コンパイル使用メモリ 6,400 KB
実行使用メモリ 17,920 KB
最終ジャッジ日時 2026-09-25 20:17:56
合計ジャッジ時間 2,166 ms
ジャッジサーバーID
(参考情報)
judge2_0 / judge4_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 34
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

(let* 
  ((l (string->number (read-line)))
   (n (string->number (read-line)))
   (w (sort! (map string->number (string-split (read-line) " ")))))
  (letrec ((count 
            (lambda (w l) 
              (cond 
                ((null? w) 0)
                ((<= (car w) l)
                  (+ 1 (count (cdr w) (- l (car w)))))
                (else 0)))))
   (print (count w l))))
0