結果

問題 No.36 素数が嫌い!
ユーザー MiyamonY
提出日時 2019-09-07 00:18:15
言語 Scheme
(Gauche-0.9.15)
結果
AC  
実行時間 2,191 ms / 5,000 ms
コード長 242 bytes
コンパイル時間 285 ms
コンパイル使用メモリ 7,200 KB
実行使用メモリ 18,048 KB
最終ジャッジ日時 2024-06-24 22:42:37
合計ジャッジ時間 11,902 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 26
権限があれば一括ダウンロードができます

ソースコード

diff #

(let* ((n (read)))

  (let1 num #?=(let loop ((i 2)
			  (m n))
		 (cond ((< m (* i i))
			(if (= m 1) 0 1))
		       ((= (mod m i) 0)
			(+ 1 (loop i #?=(div m i))))
		       (else
			(loop (+ i 1) m))))
	(print (if (> num 2) "YES" "NO"))))
0