結果

問題 No.3030 ミラー・ラビン素数判定法のテスト
ユーザー はむ吉🐹はむ吉🐹
提出日時 2017-11-19 19:34:43
言語 Scheme
(Gauche-0.9.14)
結果
WA  
実行時間 -
コード長 334 bytes
コンパイル時間 64 ms
コンパイル使用メモリ 5,248 KB
実行使用メモリ 38,400 KB
最終ジャッジ日時 2024-04-29 12:50:58
合計ジャッジ時間 22,022 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 120 ms
29,312 KB
testcase_01 AC 122 ms
29,312 KB
testcase_02 AC 121 ms
29,440 KB
testcase_03 AC 125 ms
29,312 KB
testcase_04 WA -
testcase_05 AC 4,111 ms
38,144 KB
testcase_06 AC 1,019 ms
38,400 KB
testcase_07 AC 1,003 ms
38,400 KB
testcase_08 AC 1,004 ms
38,144 KB
testcase_09 AC 8,469 ms
38,260 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

(use math.prime)
(use srfi-42)

(define (b2i b) (if b 1 0))

(define (is-prime? n) (if (> n 1) (miller-rabin-prime? n :num-tests 15) #f))

(define (report n) (format "~d ~d" n (b2i (is-prime? n))))

(define (main-proc)
    (let* ((n (read)) (xs (list-ec (:range v n) (read))))
        (for-each print (map report xs) )))

(main-proc)
0