結果

問題 No.3030 ミラー・ラビン素数判定法のテスト
ユーザー neko_the_shadowneko_the_shadow
提出日時 2019-02-07 21:51:00
言語 Ruby
(3.3.0)
結果
AC  
実行時間 5,372 ms / 9,973 ms
コード長 161 bytes
コンパイル時間 136 ms
コンパイル使用メモリ 7,552 KB
実行使用メモリ 20,224 KB
最終ジャッジ日時 2024-04-28 09:19:40
合計ジャッジ時間 13,435 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 131 ms
18,816 KB
testcase_01 AC 126 ms
18,688 KB
testcase_02 AC 129 ms
18,816 KB
testcase_03 AC 128 ms
18,816 KB
testcase_04 AC 2,648 ms
20,224 KB
testcase_05 AC 2,453 ms
20,096 KB
testcase_06 AC 351 ms
20,096 KB
testcase_07 AC 356 ms
20,224 KB
testcase_08 AC 345 ms
20,224 KB
testcase_09 AC 5,372 ms
20,096 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

require 'openssl'

n = gets.to_i
x = n.times.map{ gets.chomp }

n.times do |i|
  is_prime = OpenSSL::BN.new(x[i]).prime? ? 1 : 0
  puts "#{x[i]} #{is_prime}"
end
0