結果

問題 No.5 数字のブロック
ユーザー RinRin
提出日時 2015-09-05 21:47:09
言語 Scheme
(Gauche-0.9.14)
結果
RE  
実行時間 -
コード長 637 bytes
コンパイル時間 262 ms
コンパイル使用メモリ 7,080 KB
実行使用メモリ 13,964 KB
最終ジャッジ日時 2023-09-26 09:14:47
合計ジャッジ時間 2,906 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 18 ms
11,752 KB
testcase_01 AC 18 ms
11,732 KB
testcase_02 RE -
testcase_03 AC 41 ms
13,868 KB
testcase_04 AC 31 ms
13,596 KB
testcase_05 AC 44 ms
13,820 KB
testcase_06 AC 31 ms
13,676 KB
testcase_07 AC 29 ms
13,264 KB
testcase_08 AC 40 ms
13,912 KB
testcase_09 AC 23 ms
12,340 KB
testcase_10 AC 46 ms
13,756 KB
testcase_11 AC 28 ms
13,088 KB
testcase_12 AC 41 ms
13,964 KB
testcase_13 AC 44 ms
13,952 KB
testcase_14 AC 17 ms
11,696 KB
testcase_15 AC 18 ms
11,920 KB
testcase_16 AC 45 ms
13,780 KB
testcase_17 AC 49 ms
13,944 KB
testcase_18 AC 46 ms
13,932 KB
testcase_19 AC 50 ms
13,760 KB
testcase_20 RE -
testcase_21 RE -
testcase_22 RE -
testcase_23 AC 18 ms
11,808 KB
testcase_24 AC 18 ms
11,864 KB
testcase_25 AC 20 ms
11,824 KB
testcase_26 RE -
testcase_27 RE -
testcase_28 RE -
testcase_29 AC 31 ms
13,568 KB
testcase_30 AC 24 ms
12,544 KB
testcase_31 RE -
testcase_32 RE -
testcase_33 RE -
権限があれば一括ダウンロードができます

ソースコード

diff #

(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))
    )
  )
)
0