結果

問題 No.5 数字のブロック
ユーザー MOD9cXWdOsRxvPyMOD9cXWdOsRxvPy
提出日時 2022-10-30 19:09:55
言語 Scheme
(Gauche-0.9.14)
結果
RE  
実行時間 -
コード長 400 bytes
コンパイル時間 84 ms
コンパイル使用メモリ 5,296 KB
実行使用メモリ 14,044 KB
最終ジャッジ日時 2023-09-21 17:35:49
合計ジャッジ時間 2,588 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
11,700 KB
testcase_01 AC 16 ms
11,676 KB
testcase_02 RE -
testcase_03 AC 22 ms
13,192 KB
testcase_04 AC 20 ms
12,904 KB
testcase_05 AC 24 ms
13,624 KB
testcase_06 AC 21 ms
12,844 KB
testcase_07 AC 19 ms
12,648 KB
testcase_08 AC 20 ms
12,992 KB
testcase_09 AC 18 ms
12,300 KB
testcase_10 AC 23 ms
13,656 KB
testcase_11 AC 19 ms
12,660 KB
testcase_12 AC 21 ms
13,176 KB
testcase_13 AC 22 ms
13,528 KB
testcase_14 AC 15 ms
11,744 KB
testcase_15 AC 15 ms
11,952 KB
testcase_16 AC 24 ms
13,572 KB
testcase_17 AC 34 ms
14,036 KB
testcase_18 AC 24 ms
13,736 KB
testcase_19 AC 35 ms
14,044 KB
testcase_20 RE -
testcase_21 RE -
testcase_22 RE -
testcase_23 AC 16 ms
11,680 KB
testcase_24 AC 16 ms
11,728 KB
testcase_25 AC 16 ms
12,024 KB
testcase_26 RE -
testcase_27 RE -
testcase_28 RE -
testcase_29 AC 19 ms
12,780 KB
testcase_30 AC 17 ms
12,404 KB
testcase_31 RE -
testcase_32 RE -
testcase_33 RE -
権限があれば一括ダウンロードができます

ソースコード

diff #

#!/usr/bin/env gosh

(define (how-meny l ws)
  (let loop ([i 0][sum 0][w (car ws)][wr (cdr ws)])
    (if (> (+ sum w) l) i
	(loop (+ i 1) (+ sum w) (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