結果

問題 No.888 約数の総和
ユーザー ducktailducktail
提出日時 2019-09-20 22:04:19
言語 Scheme
(Gauche-0.9.14)
結果
AC  
実行時間 90 ms / 2,000 ms
コード長 453 bytes
コンパイル時間 106 ms
コンパイル使用メモリ 5,156 KB
実行使用メモリ 11,900 KB
最終ジャッジ日時 2023-10-12 19:13:28
合計ジャッジ時間 2,902 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 17 ms
11,672 KB
testcase_01 AC 18 ms
11,876 KB
testcase_02 AC 17 ms
11,688 KB
testcase_03 AC 17 ms
11,880 KB
testcase_04 AC 17 ms
11,860 KB
testcase_05 AC 17 ms
11,676 KB
testcase_06 AC 17 ms
11,656 KB
testcase_07 AC 18 ms
11,840 KB
testcase_08 AC 17 ms
11,876 KB
testcase_09 AC 17 ms
11,772 KB
testcase_10 AC 18 ms
11,684 KB
testcase_11 AC 19 ms
11,776 KB
testcase_12 AC 18 ms
11,756 KB
testcase_13 AC 17 ms
11,896 KB
testcase_14 AC 17 ms
11,672 KB
testcase_15 AC 18 ms
11,900 KB
testcase_16 AC 17 ms
11,864 KB
testcase_17 AC 17 ms
11,784 KB
testcase_18 AC 90 ms
11,760 KB
testcase_19 AC 71 ms
11,752 KB
testcase_20 AC 55 ms
11,672 KB
testcase_21 AC 86 ms
11,856 KB
testcase_22 AC 88 ms
11,736 KB
testcase_23 AC 20 ms
11,776 KB
testcase_24 AC 46 ms
11,892 KB
testcase_25 AC 54 ms
11,860 KB
testcase_26 AC 54 ms
11,668 KB
testcase_27 AC 72 ms
11,684 KB
testcase_28 AC 73 ms
11,876 KB
testcase_29 AC 74 ms
11,872 KB
testcase_30 AC 77 ms
11,672 KB
testcase_31 AC 82 ms
11,744 KB
testcase_32 AC 89 ms
11,684 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

(define (divisor n)
  (let loop ([i 1]
             [l '()])
    (cond [(> (* i i) n) l]
          [(zero? (remainder n i)) (if (= i (quotient n i))
                                       (loop (+ i 1) (cons i l))
                                       (loop (+ i 1) (cons i (cons (quotient n i) l))))]
          [else (loop (+ i 1) l)])))

(define (solve n)
  (apply + (divisor n)))

(define (main args)
  (let ([n (read)])
    (print (solve n)))
  0)
0