結果

問題 No.888 約数の総和
ユーザー ducktail
提出日時 2019-09-20 22:01:26
言語 Scheme
(Gauche-0.9.15)
結果
WA  
実行時間 -
コード長 323 bytes
コンパイル時間 311 ms
コンパイル使用メモリ 5,632 KB
実行使用メモリ 16,128 KB
最終ジャッジ日時 2024-09-14 17:32:49
合計ジャッジ時間 2,968 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 15 WA * 15
権限があれば一括ダウンロードができます

ソースコード

diff #

(define (divisor n)
  (let loop ([i 1]
             [l '()])
    (cond [(> (* i i) n) l]
          [(zero? (remainder n i)) (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