結果
問題 | No.5 数字のブロック |
ユーザー |
|
提出日時 | 2021-04-01 17:06:24 |
言語 | Scheme (Gauche-0.9.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 384 bytes |
コンパイル時間 | 148 ms |
コンパイル使用メモリ | 6,688 KB |
実行使用メモリ | 17,792 KB |
最終ジャッジ日時 | 2024-12-17 20:36:40 |
合計ジャッジ時間 | 2,496 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | WA * 34 |
ソースコード
(define l (string->number (read-line)))(read-line)(define ws (sort (map string->number (string-split (read-line) " "))))(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))))))