結果

問題 No.3030 ミラー・ラビン素数判定法のテスト
ユーザー はむ吉🐹はむ吉🐹
提出日時 2017-11-22 22:06:26
言語 Scheme
(Gauche-0.9.14)
結果
AC  
実行時間 3,886 ms / 9,973 ms
コード長 317 bytes
コンパイル時間 112 ms
コンパイル使用メモリ 5,504 KB
実行使用メモリ 33,280 KB
最終ジャッジ日時 2024-04-28 09:15:08
合計ジャッジ時間 18,025 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 129 ms
27,136 KB
testcase_01 AC 127 ms
27,392 KB
testcase_02 AC 120 ms
27,648 KB
testcase_03 AC 122 ms
27,648 KB
testcase_04 AC 2,416 ms
33,280 KB
testcase_05 AC 2,821 ms
33,024 KB
testcase_06 AC 2,516 ms
33,024 KB
testcase_07 AC 2,510 ms
33,024 KB
testcase_08 AC 2,526 ms
33,152 KB
testcase_09 AC 3,886 ms
33,152 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

(use gauche.generator)
(use math.prime)

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

(define (is-prime? n) (if (> n 1) (bpsw-prime? n) #f))

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

(define (main-proc)
    (let* ((n (read)) (xs (gtake read n)))
        (generator-for-each print (gmap report xs) )))

(main-proc)
0