結果
問題 |
No.5 数字のブロック
|
ユーザー |
![]() |
提出日時 | 2015-09-05 21:48:07 |
言語 | Scheme (Gauche-0.9.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 638 bytes |
コンパイル時間 | 105 ms |
コンパイル使用メモリ | 5,120 KB |
実行使用メモリ | 18,688 KB |
最終ジャッジ日時 | 2024-07-19 04:14:45 |
合計ジャッジ時間 | 2,309 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 20 WA * 7 RE * 7 |
ソースコード
(define (System.out.println x) (begin (display x) (newline) ) ) (let ( (Capacity (read)) (N (read)) ) (let loop( (ls '()) (foo (read)) ) (if (eof-object? foo) (let loop2( (RemainingCapacity Capacity) (UsedBlocks 0) (bar (sort ls <)) ) (if (<= (- RemainingCapacity (car bar)) 0) (System.out.println UsedBlocks) (loop2 (- RemainingCapacity (car bar)) (+ UsedBlocks 1) (cdr bar)) ) ) (loop (cons foo ls) (read)) ) ) )