結果

問題 No.888 約数の総和
ユーザー MiyamonYMiyamonY
提出日時 2019-09-29 00:58:01
言語 Scheme
(Gauche-0.9.13)
結果
AC  
実行時間 346 ms / 2,000 ms
コード長 976 bytes
コンパイル時間 267 ms
コンパイル使用メモリ 5,376 KB
実行使用メモリ 114,172 KB
最終ジャッジ日時 2023-07-26 17:35:37
合計ジャッジ時間 6,111 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 26 ms
12,656 KB
testcase_01 AC 26 ms
12,876 KB
testcase_02 AC 26 ms
12,740 KB
testcase_03 AC 18 ms
11,708 KB
testcase_04 AC 26 ms
14,708 KB
testcase_05 AC 26 ms
12,896 KB
testcase_06 AC 26 ms
12,916 KB
testcase_07 AC 26 ms
12,948 KB
testcase_08 AC 26 ms
12,672 KB
testcase_09 AC 26 ms
12,712 KB
testcase_10 AC 26 ms
12,868 KB
testcase_11 AC 26 ms
12,824 KB
testcase_12 AC 27 ms
12,784 KB
testcase_13 AC 25 ms
12,840 KB
testcase_14 AC 26 ms
12,768 KB
testcase_15 AC 27 ms
12,736 KB
testcase_16 AC 26 ms
13,004 KB
testcase_17 AC 26 ms
12,756 KB
testcase_18 AC 346 ms
113,824 KB
testcase_19 AC 291 ms
87,816 KB
testcase_20 AC 202 ms
65,708 KB
testcase_21 AC 337 ms
111,940 KB
testcase_22 AC 345 ms
112,968 KB
testcase_23 AC 42 ms
15,872 KB
testcase_24 AC 173 ms
52,476 KB
testcase_25 AC 195 ms
62,856 KB
testcase_26 AC 199 ms
65,324 KB
testcase_27 AC 291 ms
88,656 KB
testcase_28 AC 298 ms
92,804 KB
testcase_29 AC 302 ms
94,928 KB
testcase_30 AC 305 ms
95,996 KB
testcase_31 AC 319 ms
104,956 KB
testcase_32 AC 340 ms
114,172 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