結果

問題 No.5 数字のブロック
ユーザー MOD9cXWdOsRxvPyMOD9cXWdOsRxvPy
提出日時 2022-10-30 23:15:04
言語 Scheme
(Gauche-0.9.14)
結果
AC  
実行時間 40 ms / 5,000 ms
コード長 428 bytes
コンパイル時間 171 ms
コンパイル使用メモリ 5,056 KB
実行使用メモリ 13,908 KB
最終ジャッジ日時 2023-09-21 20:57:51
合計ジャッジ時間 3,589 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 19 ms
11,868 KB
testcase_01 AC 19 ms
11,860 KB
testcase_02 AC 20 ms
11,660 KB
testcase_03 AC 25 ms
13,296 KB
testcase_04 AC 24 ms
12,780 KB
testcase_05 AC 26 ms
13,676 KB
testcase_06 AC 24 ms
12,936 KB
testcase_07 AC 23 ms
12,624 KB
testcase_08 AC 24 ms
12,976 KB
testcase_09 AC 20 ms
12,076 KB
testcase_10 AC 27 ms
13,844 KB
testcase_11 AC 23 ms
12,688 KB
testcase_12 AC 26 ms
13,352 KB
testcase_13 AC 26 ms
13,448 KB
testcase_14 AC 20 ms
11,764 KB
testcase_15 AC 19 ms
11,692 KB
testcase_16 AC 27 ms
13,536 KB
testcase_17 AC 40 ms
13,824 KB
testcase_18 AC 27 ms
13,712 KB
testcase_19 AC 40 ms
13,908 KB
testcase_20 AC 19 ms
11,660 KB
testcase_21 AC 19 ms
11,632 KB
testcase_22 AC 18 ms
11,884 KB
testcase_23 AC 18 ms
11,636 KB
testcase_24 AC 19 ms
11,692 KB
testcase_25 AC 19 ms
11,972 KB
testcase_26 AC 18 ms
11,644 KB
testcase_27 AC 19 ms
11,656 KB
testcase_28 AC 19 ms
11,884 KB
testcase_29 AC 23 ms
13,024 KB
testcase_30 AC 21 ms
12,176 KB
testcase_31 AC 18 ms
11,840 KB
testcase_32 AC 19 ms
11,856 KB
testcase_33 AC 18 ms
11,672 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#!/usr/bin/env gosh

(define (how-meny l ws)
  (let loop ([i 1][sum (car ws)][wr (cdr ws)])
    (cond
     ((> sum l) (- i 1))
     ((null? wr) i)
     (else (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