結果

問題 No.5 数字のブロック
ユーザー MOD9cXWdOsRxvPyMOD9cXWdOsRxvPy
提出日時 2022-10-30 22:47:08
言語 Scheme
(Gauche-0.9.14)
結果
AC  
実行時間 36 ms / 5,000 ms
コード長 411 bytes
コンパイル時間 42 ms
コンパイル使用メモリ 5,216 KB
実行使用メモリ 14,184 KB
最終ジャッジ日時 2023-09-21 20:38:25
合計ジャッジ時間 2,429 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 17 ms
11,772 KB
testcase_01 AC 17 ms
11,700 KB
testcase_02 AC 17 ms
11,676 KB
testcase_03 AC 24 ms
13,124 KB
testcase_04 AC 21 ms
12,828 KB
testcase_05 AC 25 ms
13,604 KB
testcase_06 AC 22 ms
12,844 KB
testcase_07 AC 21 ms
12,644 KB
testcase_08 AC 23 ms
13,212 KB
testcase_09 AC 20 ms
14,128 KB
testcase_10 AC 25 ms
13,660 KB
testcase_11 AC 21 ms
12,800 KB
testcase_12 AC 23 ms
13,164 KB
testcase_13 AC 25 ms
13,572 KB
testcase_14 AC 18 ms
11,688 KB
testcase_15 AC 17 ms
11,808 KB
testcase_16 AC 25 ms
13,728 KB
testcase_17 AC 36 ms
13,848 KB
testcase_18 AC 25 ms
14,012 KB
testcase_19 AC 36 ms
14,184 KB
testcase_20 AC 17 ms
11,876 KB
testcase_21 AC 16 ms
11,760 KB
testcase_22 AC 17 ms
11,692 KB
testcase_23 AC 16 ms
11,668 KB
testcase_24 AC 18 ms
11,720 KB
testcase_25 AC 17 ms
11,968 KB
testcase_26 AC 16 ms
11,664 KB
testcase_27 AC 16 ms
11,848 KB
testcase_28 AC 17 ms
11,872 KB
testcase_29 AC 21 ms
12,872 KB
testcase_30 AC 18 ms
12,280 KB
testcase_31 AC 16 ms
11,700 KB
testcase_32 AC 17 ms
11,856 KB
testcase_33 AC 17 ms
11,744 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#!/usr/bin/env gosh

(define (how-meny l ws)
  (let loop ([i 1][sum (car ws)][wr (cdr ws)])
    (if (> sum l) (- i 1)
	(if (null? wr) i
	    (loop (+ i 1) (+ sum (car wr)) (cdr wr))))
    )
  )

(define (main _)
  (let* ([l (read)])
    (read)(read-char)
    (let ([ws (sort
	       (map (^x (string->number x))
		    (string-split (read-line) " ")))])
      (display (how-meny l ws))
      ))
  (newline)
  0)
0