結果

問題 No.36 素数が嫌い!
ユーザー MiyamonYMiyamonY
提出日時 2019-09-06 19:32:10
言語 Scheme
(Gauche-0.9.14)
結果
WA  
実行時間 -
コード長 368 bytes
コンパイル時間 49 ms
コンパイル使用メモリ 5,220 KB
実行使用メモリ 29,560 KB
最終ジャッジ日時 2023-09-06 15:07:54
合計ジャッジ時間 10,191 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 101 ms
24,816 KB
testcase_01 WA -
testcase_02 AC 93 ms
22,692 KB
testcase_03 AC 92 ms
22,676 KB
testcase_04 AC 91 ms
22,748 KB
testcase_05 AC 90 ms
22,968 KB
testcase_06 AC 373 ms
27,804 KB
testcase_07 AC 92 ms
22,668 KB
testcase_08 AC 94 ms
22,764 KB
testcase_09 AC 91 ms
22,668 KB
testcase_10 AC 92 ms
22,612 KB
testcase_11 AC 95 ms
24,776 KB
testcase_12 AC 96 ms
22,616 KB
testcase_13 TLE -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
testcase_28 -- -
testcase_29 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

(use math.prime)

(let* ((n (read)))
  (let1 m
	(let loop ((primes *primes*)
		   (m n)
		   (num 0))
	  (let1 prime #?=(car primes)
		(cond  ((< m (* prime prime)) num)
		       ((small-prime? m) (+ num 1))
		       (else
			(if (= (mod m prime) 0)
			    (loop primes (div m prime) (+ num 1))
			    (loop (cdr primes) m num))))))
	(print (if (> m 2) "YES" "NO"))))
0