結果

問題 No.316 もっと刺激的なFizzBuzzをください
ユーザー schemelispschemelisp
提出日時 2015-12-15 13:13:42
言語 Scheme
(Gauche-0.9.14)
結果
AC  
実行時間 32 ms / 1,000 ms
コード長 421 bytes
コンパイル時間 111 ms
コンパイル使用メモリ 5,376 KB
実行使用メモリ 17,280 KB
最終ジャッジ日時 2024-05-01 08:48:45
合計ジャッジ時間 2,545 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 28 ms
17,024 KB
testcase_01 AC 27 ms
17,024 KB
testcase_02 AC 26 ms
17,152 KB
testcase_03 AC 32 ms
17,152 KB
testcase_04 AC 27 ms
17,024 KB
testcase_05 AC 30 ms
17,024 KB
testcase_06 AC 29 ms
17,024 KB
testcase_07 AC 28 ms
17,152 KB
testcase_08 AC 29 ms
17,024 KB
testcase_09 AC 27 ms
17,024 KB
testcase_10 AC 27 ms
17,152 KB
testcase_11 AC 28 ms
17,024 KB
testcase_12 AC 27 ms
17,152 KB
testcase_13 AC 27 ms
17,024 KB
testcase_14 AC 27 ms
17,024 KB
testcase_15 AC 26 ms
17,024 KB
testcase_16 AC 28 ms
17,152 KB
testcase_17 AC 29 ms
17,280 KB
testcase_18 AC 27 ms
17,152 KB
testcase_19 AC 28 ms
17,024 KB
testcase_20 AC 28 ms
17,024 KB
testcase_21 AC 27 ms
17,024 KB
testcase_22 AC 27 ms
17,024 KB
testcase_23 AC 27 ms
17,024 KB
testcase_24 AC 27 ms
17,024 KB
testcase_25 AC 28 ms
17,024 KB
testcase_26 AC 28 ms
17,024 KB
testcase_27 AC 28 ms
17,024 KB
testcase_28 AC 28 ms
17,024 KB
testcase_29 AC 28 ms
17,152 KB
testcase_30 AC 27 ms
17,024 KB
testcase_31 AC 27 ms
17,024 KB
testcase_32 AC 27 ms
17,024 KB
testcase_33 AC 27 ms
17,152 KB
testcase_34 AC 26 ms
17,024 KB
testcase_35 AC 26 ms
17,024 KB
testcase_36 AC 26 ms
17,152 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

(define (gcd x y)
  (let ((r (mod x y)))
    (if (= r 0)
	y
	(gcd y r))))

(define (lcm x y)
  (/ (* x y) (gcd x y)))

(define (sum n a b c)
  (-
   (+ (quotient n a)
      (quotient n b)
      (quotient n c)
      (quotient n (lcm a (lcm b c))))
   (quotient n (lcm a b))
   (quotient n (lcm b c))
   (quotient n (lcm c a))))

(let ((n (read))
      (a (read))
      (b (read))
      (c (read)))
  (print (sum n a b c)))
0