結果

問題 No.12 限定された素数
ユーザー 👑 hos.lyrichos.lyric
提出日時 2015-03-01 20:31:24
言語 Ruby
(3.3.0)
結果
WA  
実行時間 -
コード長 206 bytes
コンパイル時間 63 ms
コンパイル使用メモリ 11,504 KB
実行使用メモリ 27,472 KB
最終ジャッジ日時 2023-09-06 05:58:10
合計ジャッジ時間 47,257 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1,558 ms
26,864 KB
testcase_01 AC 1,728 ms
26,824 KB
testcase_02 AC 1,574 ms
27,276 KB
testcase_03 WA -
testcase_04 AC 1,609 ms
26,972 KB
testcase_05 AC 1,761 ms
27,104 KB
testcase_06 AC 1,733 ms
27,348 KB
testcase_07 AC 1,867 ms
27,072 KB
testcase_08 AC 1,665 ms
27,172 KB
testcase_09 AC 1,638 ms
27,300 KB
testcase_10 AC 1,756 ms
27,040 KB
testcase_11 AC 1,957 ms
26,992 KB
testcase_12 AC 1,875 ms
27,136 KB
testcase_13 AC 1,754 ms
27,032 KB
testcase_14 AC 1,710 ms
27,316 KB
testcase_15 AC 1,754 ms
27,056 KB
testcase_16 AC 1,963 ms
26,984 KB
testcase_17 AC 1,558 ms
26,920 KB
testcase_18 AC 1,575 ms
27,084 KB
testcase_19 AC 1,570 ms
26,708 KB
testcase_20 AC 1,562 ms
26,936 KB
testcase_21 AC 1,624 ms
26,936 KB
testcase_22 AC 1,575 ms
26,852 KB
testcase_23 AC 1,580 ms
27,028 KB
testcase_24 AC 1,560 ms
27,472 KB
testcase_25 AC 1,773 ms
26,708 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

require'prime'
gets
b=0
gets.split.map{|a|b|=1<<a.ord-48}
c=0
l=0
z=1
Prime.each(5e6+11){|x|
  c<b||z=[z,[x,5e6].min-l].max
  (c=0;l=x)if x.to_s.each_char.any?{|y|
    c|=1<<y.ord-48
    (b|c)>b
  }
}
p z-2
0