結果
| 問題 | No.5 数字のブロック |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2021-04-01 17:07:14 |
| 言語 | Scheme (Gauche-0.9.15) |
| 結果 |
AC
|
| 実行時間 | 50 ms / 5,000 ms |
| コード長 | 427 bytes |
| 記録 | |
| コンパイル時間 | 94 ms |
| コンパイル使用メモリ | 8,100 KB |
| 実行使用メモリ | 18,176 KB |
| 最終ジャッジ日時 | 2026-05-26 23:45:05 |
| 合計ジャッジ時間 | 2,108 ms |
|
ジャッジサーバーID (参考情報) |
judge1_1 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 34 |
ソースコード
(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)))))))