結果

問題 No.5 数字のブロック
ユーザー RinRin
提出日時 2015-09-05 21:48:07
言語 Scheme
(Gauche-0.9.14)
結果
WA  
実行時間 -
コード長 638 bytes
コンパイル時間 299 ms
コンパイル使用メモリ 5,324 KB
実行使用メモリ 15,720 KB
最終ジャッジ日時 2023-09-26 09:14:50
合計ジャッジ時間 2,574 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 18 ms
11,780 KB
testcase_01 AC 18 ms
13,720 KB
testcase_02 WA -
testcase_03 AC 41 ms
13,760 KB
testcase_04 AC 31 ms
13,656 KB
testcase_05 WA -
testcase_06 AC 33 ms
13,712 KB
testcase_07 AC 29 ms
13,212 KB
testcase_08 AC 40 ms
13,752 KB
testcase_09 AC 23 ms
12,548 KB
testcase_10 AC 47 ms
13,948 KB
testcase_11 AC 28 ms
13,128 KB
testcase_12 AC 41 ms
13,944 KB
testcase_13 AC 45 ms
13,820 KB
testcase_14 AC 18 ms
11,804 KB
testcase_15 WA -
testcase_16 AC 45 ms
13,868 KB
testcase_17 AC 49 ms
13,848 KB
testcase_18 AC 47 ms
14,008 KB
testcase_19 AC 50 ms
13,772 KB
testcase_20 RE -
testcase_21 WA -
testcase_22 WA -
testcase_23 AC 19 ms
11,788 KB
testcase_24 AC 19 ms
11,884 KB
testcase_25 AC 19 ms
11,932 KB
testcase_26 RE -
testcase_27 RE -
testcase_28 RE -
testcase_29 WA -
testcase_30 WA -
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