結果

問題 No.9008 空白区切りで与えられる数値データの合計値を求める(テスト用)
ユーザー wagasa2wagasa2
提出日時 2018-11-11 01:12:29
言語 Scheme
(Gauche-0.9.14)
結果
AC  
実行時間 394 ms / 2,000 ms
コード長 275 bytes
コンパイル時間 60 ms
コンパイル使用メモリ 5,304 KB
実行使用メモリ 76,216 KB
最終ジャッジ日時 2023-08-17 12:20:20
合計ジャッジ時間 4,073 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 18 ms
11,752 KB
testcase_01 AC 17 ms
11,848 KB
testcase_02 AC 17 ms
11,660 KB
testcase_03 AC 17 ms
11,652 KB
testcase_04 AC 17 ms
11,816 KB
testcase_05 AC 18 ms
11,744 KB
testcase_06 AC 18 ms
11,768 KB
testcase_07 AC 32 ms
13,956 KB
testcase_08 AC 71 ms
19,792 KB
testcase_09 AC 99 ms
28,224 KB
testcase_10 AC 310 ms
67,404 KB
testcase_11 AC 307 ms
70,280 KB
testcase_12 AC 315 ms
71,544 KB
testcase_13 AC 363 ms
71,960 KB
testcase_14 AC 361 ms
72,112 KB
testcase_15 AC 364 ms
72,100 KB
testcase_16 AC 394 ms
76,216 KB
testcase_17 AC 18 ms
11,848 KB
testcase_18 AC 18 ms
11,668 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

(define (sum-list lst)
  (define (sum-listx lst ans)
    (if (null? lst) ans
        (sum-listx (cdr lst) (+ ans (car lst)))))
  (sum-listx lst 0))
(define (create-list n)
  (if (= n 0) '()
      (cons (read) (create-list (- n 1)))))
(display (sum-list (create-list (read))))
0