結果

問題 No.36 素数が嫌い!
ユーザー MiyamonYMiyamonY
提出日時 2019-09-07 00:18:15
言語 Scheme
(Gauche-0.9.14)
結果
AC  
実行時間 2,240 ms / 5,000 ms
コード長 242 bytes
コンパイル時間 90 ms
コンパイル使用メモリ 5,336 KB
実行使用メモリ 14,108 KB
最終ジャッジ日時 2023-09-07 04:06:26
合計ジャッジ時間 12,509 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 542 ms
13,736 KB
testcase_01 AC 71 ms
13,756 KB
testcase_02 AC 23 ms
12,716 KB
testcase_03 AC 30 ms
13,776 KB
testcase_04 AC 30 ms
13,720 KB
testcase_05 AC 34 ms
13,720 KB
testcase_06 AC 37 ms
13,712 KB
testcase_07 AC 39 ms
13,768 KB
testcase_08 AC 31 ms
13,804 KB
testcase_09 AC 33 ms
14,004 KB
testcase_10 AC 31 ms
13,756 KB
testcase_11 AC 748 ms
13,732 KB
testcase_12 AC 2,240 ms
13,820 KB
testcase_13 AC 2,238 ms
13,680 KB
testcase_14 AC 40 ms
13,848 KB
testcase_15 AC 30 ms
13,792 KB
testcase_16 AC 30 ms
13,852 KB
testcase_17 AC 23 ms
12,700 KB
testcase_18 AC 32 ms
14,108 KB
testcase_19 AC 121 ms
13,800 KB
testcase_20 AC 100 ms
13,760 KB
testcase_21 AC 320 ms
13,852 KB
testcase_22 AC 64 ms
13,760 KB
testcase_23 AC 45 ms
13,728 KB
testcase_24 AC 347 ms
13,828 KB
testcase_25 AC 410 ms
13,784 KB
testcase_26 AC 803 ms
13,836 KB
testcase_27 AC 72 ms
13,896 KB
testcase_28 AC 790 ms
13,744 KB
testcase_29 AC 46 ms
13,876 KB
権限があれば一括ダウンロードができます

ソースコード

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