結果

問題 No.888 約数の総和
ユーザー MiyamonYMiyamonY
提出日時 2019-09-29 00:58:01
言語 Scheme
(Gauche-0.9.14)
結果
AC  
実行時間 364 ms / 2,000 ms
コード長 976 bytes
コンパイル時間 363 ms
コンパイル使用メモリ 6,944 KB
実行使用メモリ 118,136 KB
最終ジャッジ日時 2024-04-14 07:09:06
合計ジャッジ時間 6,329 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 33 ms
17,024 KB
testcase_01 AC 33 ms
17,024 KB
testcase_02 AC 32 ms
17,280 KB
testcase_03 AC 25 ms
15,872 KB
testcase_04 AC 32 ms
17,280 KB
testcase_05 AC 32 ms
17,024 KB
testcase_06 AC 32 ms
17,024 KB
testcase_07 AC 32 ms
17,024 KB
testcase_08 AC 32 ms
17,024 KB
testcase_09 AC 32 ms
17,152 KB
testcase_10 AC 32 ms
17,152 KB
testcase_11 AC 32 ms
17,024 KB
testcase_12 AC 32 ms
17,024 KB
testcase_13 AC 32 ms
17,024 KB
testcase_14 AC 33 ms
17,152 KB
testcase_15 AC 32 ms
17,152 KB
testcase_16 AC 32 ms
17,152 KB
testcase_17 AC 33 ms
17,280 KB
testcase_18 AC 364 ms
118,136 KB
testcase_19 AC 304 ms
91,644 KB
testcase_20 AC 211 ms
70,440 KB
testcase_21 AC 354 ms
114,320 KB
testcase_22 AC 359 ms
116,964 KB
testcase_23 AC 48 ms
19,840 KB
testcase_24 AC 186 ms
56,704 KB
testcase_25 AC 211 ms
67,904 KB
testcase_26 AC 209 ms
69,108 KB
testcase_27 AC 309 ms
92,556 KB
testcase_28 AC 317 ms
95,756 KB
testcase_29 AC 325 ms
98,068 KB
testcase_30 AC 325 ms
100,244 KB
testcase_31 AC 345 ms
109,544 KB
testcase_32 AC 362 ms
117,984 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

;;; File:  main.scm
;; Author: ymiyamoto
;;
;; Created on Sun Sep 29 00:48:50 2019
;;
(define-syntax read-number
  (syntax-rules ()
    ((_ nums)
     (define-values nums
       (apply values (map string->number (string-split (read-line) #\space)))))))

(define-syntax read-numbers
  (syntax-rules ()
    ((_ as)
     (define as (map string->number (string-split (read-line) #\space))))
    ((_ as n)
     (define as (map (lambda (_) (map string->number (string-split (read-line) #\space))) (iota n))))))

(define-syntax prlist
  (syntax-rules ()
    ((_ lis)
     (print (string-join (map number->string lis) " ")))))

(define-syntax 1+ (syntax-rules () ((_ x) (+ x 1))))

(define-syntax 1- (syntax-rules () ((_ x) (- x 1))))

(define MOD 1000000007)

(define (solve)
  (read-number (n))

  (print (let loop ((i 1))
	   (cond
	    ((= (* i i) n) (+ i (loop (1+ i))))
	    ((< (* i i) n) (+ (if (= (modulo n i) 0) (+ i (div n i)) 0) (loop (1+ i))))
	    (else 0)))))

(solve)
0