結果

問題 No.36 素数が嫌い!
ユーザー MiyamonYMiyamonY
提出日時 2019-09-05 14:07:39
言語 Scheme
(Gauche-0.9.14)
結果
WA  
実行時間 -
コード長 398 bytes
コンパイル時間 57 ms
コンパイル使用メモリ 5,376 KB
実行使用メモリ 24,472 KB
最終ジャッジ日時 2023-09-02 08:42:01
合計ジャッジ時間 5,450 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 102 ms
22,372 KB
testcase_01 WA -
testcase_02 AC 103 ms
22,408 KB
testcase_03 AC 103 ms
24,436 KB
testcase_04 WA -
testcase_05 AC 102 ms
22,492 KB
testcase_06 AC 103 ms
22,388 KB
testcase_07 AC 103 ms
22,332 KB
testcase_08 WA -
testcase_09 AC 103 ms
22,312 KB
testcase_10 WA -
testcase_11 AC 102 ms
22,408 KB
testcase_12 AC 102 ms
22,548 KB
testcase_13 AC 102 ms
22,540 KB
testcase_14 WA -
testcase_15 WA -
testcase_16 AC 102 ms
22,488 KB
testcase_17 AC 101 ms
22,452 KB
testcase_18 AC 102 ms
22,344 KB
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 AC 101 ms
22,544 KB
testcase_27 AC 104 ms
22,528 KB
testcase_28 AC 102 ms
22,288 KB
testcase_29 AC 103 ms
22,412 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

(use math.prime)

(let* ((n (read)))
  (let1 result
	(let loop ((n n)
		   (primes *primes*))
	  (let1 prime (car primes)
		(cond ((= n 1) #f)
		      ((< n (car primes)) #f)
		      (else
		       (let1 m (let loop ((n n))
				 (if (= (mod n prime) 0)
				     (+ 1 (loop (div n prime)))
				     0))
			     (if (> m 1)
				 #t
				 (loop m (cdr primes))))))))

	(print (if result "YES" "NO"))))
0