結果

問題 No.5 数字のブロック
ユーザー Yuzu MashiroYuzu Mashiro
提出日時 2021-04-01 17:07:14
言語 Scheme
(Gauche-0.9.14)
結果
AC  
実行時間 38 ms / 5,000 ms
コード長 427 bytes
コンパイル時間 53 ms
コンパイル使用メモリ 5,376 KB
実行使用メモリ 13,980 KB
最終ジャッジ日時 2023-08-22 19:44:04
合計ジャッジ時間 2,098 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 18 ms
11,644 KB
testcase_01 AC 19 ms
11,756 KB
testcase_02 AC 19 ms
11,872 KB
testcase_03 AC 23 ms
13,080 KB
testcase_04 AC 21 ms
12,756 KB
testcase_05 AC 25 ms
13,464 KB
testcase_06 AC 22 ms
12,924 KB
testcase_07 AC 21 ms
12,608 KB
testcase_08 AC 22 ms
13,072 KB
testcase_09 AC 20 ms
12,096 KB
testcase_10 AC 26 ms
13,692 KB
testcase_11 AC 21 ms
12,560 KB
testcase_12 AC 23 ms
13,196 KB
testcase_13 AC 25 ms
13,688 KB
testcase_14 AC 19 ms
11,664 KB
testcase_15 AC 17 ms
11,908 KB
testcase_16 AC 25 ms
13,612 KB
testcase_17 AC 36 ms
13,892 KB
testcase_18 AC 26 ms
13,784 KB
testcase_19 AC 38 ms
13,980 KB
testcase_20 AC 18 ms
11,896 KB
testcase_21 AC 18 ms
11,852 KB
testcase_22 AC 17 ms
11,636 KB
testcase_23 AC 18 ms
11,692 KB
testcase_24 AC 18 ms
11,688 KB
testcase_25 AC 18 ms
11,980 KB
testcase_26 AC 18 ms
11,856 KB
testcase_27 AC 18 ms
11,712 KB
testcase_28 AC 17 ms
11,864 KB
testcase_29 AC 22 ms
12,856 KB
testcase_30 AC 20 ms
12,152 KB
testcase_31 AC 18 ms
11,632 KB
testcase_32 AC 18 ms
11,632 KB
testcase_33 AC 18 ms
11,644 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

(define l (string->number (read-line)))
(read-line)
(define ws (sort (map string->number (string-split (read-line) " "))))

(print (let loop ((count 0) (total 0) (head (car ws)) (tail (cdr ws)))
        (let* ((total+ (+ total head))
               (overflow? (> total+ l)))
          (cond (overflow? count)
                ((null? tail) (+ count 1))
                (else (loop (+ count 1) total+ (car tail) (cdr tail)))))))
0